|
Group: Forum Members
Posts: 5,
Visits: 1
|
hi again, i check the sample but I had some troubles,
I Create a sample application to testing, create the Dockmanager and the Dockpanels code in the contructor method of the form. and then a create an instance of the NDockingFrameworkState class to save the state, and later load it, the file is saved but when a load it the docks don't come back to the saved position.
this is my code:
public partial class Form1 : Form { NDockManager m_dockManager; NDockingFrameworkState state; string path; public Form1() { InitializeComponent(); #region GeneracionPorCodigo NDockManager manager = new NDockManager(); NDockingPanel dock12 = new NDockingPanel(); NDockingPanel dock1 = new NDockingPanel(); NDockingPanel dock3 = new NDockingPanel();
NDockingPanelHost nDockZone1 = new NDockingPanelHost(); NDockZone nDockZone2 = new NDockZone(); NDockingPanelHost nDockZone3 = new NDockingPanelHost(); NDockingPanelHost nDockZone4 = new NDockingPanelHost();
manager.Form = this; manager.RootContainerZIndex = 0; manager.UndockToleranceSize = 2;
manager.RootContainer.RootZone.AddChild(nDockZone1); manager.RootContainer.RootZone.AddChild(nDockZone2); manager.RootContainer.RootZone.Orientation = Orientation.Vertical;
nDockZone1.AddChild(dock3); nDockZone1.Orientation = Orientation.Horizontal; nDockZone1.Index = 0;
nDockZone2.AddChild(nDockZone3); nDockZone2.AddChild(nDockZone4); nDockZone2.AddChild(manager.DocumentManager.DocumentViewHost); nDockZone2.Orientation = Orientation.Horizontal; nDockZone2.Index = 1;
nDockZone3.AddChild(dock1); nDockZone3.Orientation = Orientation.Horizontal; nDockZone3.Index = 0;
nDockZone4.AddChild(dock12); nDockZone4.Name = "nDockZone4"; nDockZone4.Orientation = Orientation.Horizontal; nDockZone4.Index = 1;
dock12.Location = new Point(1, 24); dock12.Size = new Size(134, 33); dock12.SizeInfo.PreferredSize = new Size(200, 200); dock12.TabIndex = 1; dock12.Text = "C";
dock1.Location = new Point(1, 24); dock1.Size = new Size(138, 33); dock1.SizeInfo.PreferredSize = new Size(200, 200); dock1.TabIndex = 1; dock1.Text = "A";
dock3.Location = new Point(1, 24); dock3.Size = new Size(282, 175); dock3.SizeInfo.PreferredSize = new Size(200, 200); dock3.TabIndex = 1; dock3.Text = "B";
Button btn = new Button(); btn.Click += new EventHandler(btn_Click); dock3.Controls.Add(btn);
btn.Location = new System.Drawing.Point(0, 0); btn.Name = "button1"; btn.Size = new System.Drawing.Size(75, 23); btn.TabIndex = 1; btn.Text = "button1"; btn.UseVisualStyleBackColor = true;
#endregion state = new NDockingFrameworkState(manager); state.Format = PersistencyFormat.XML; path = "DockStatus.xml"; state.Save(path); }
void btn_Click(object sender, EventArgs e) { state.Load(path); }
}
I don't know if i have to do something else. in the sample don't appear more interaction with the NDockingFrameworkState object that the save and load. or I have to do something else with the NDockManager?
|