We have a DockManager with a ContentPane called the Action Panel, and a DocumentContentHost that contains multiple document based Content Panes. The user is allowed to move the Action Panel and dock it to either the left or the right borders of the DockManager. We need a programmatic way of restoring this when the app reopens (without saving the entire DockManager layout).
We can find and save the current location of the Action Panel using the ContentPane.PaneLocation property. However this property is readonly and therefore we can't set it to restore the last location of this ContentPane before the user last exited the application.
Is there a programmatic way of moving the Action Panel ContentPane so its docked to either the left or right edges of the DockManager?
Best regards, and thanks in advance!
The best way to save and restore the layout of the xamDockManager is using the SaveLayout/LoadLayout methods. This will save all the state of the panes - e.g. resizing, whether its been floating, if so where and with what panes, if its unpinned, etc. If this is a dynamically created ContentPane then be sure to set the SerializationId to some unique information that you can use to recreate/locate the pane content when you load the layout and handle the InitializePaneContent event.
If you want to handle the positioning manually then you will need to create the element tree as you would have in code or xaml - e.g. assuming you wanted to dock it on the left (outside the documentcontenthost), create a SplitPane, set its InitializePaneLocation to DockedLeft, add the ContentPane to its Panes collection, add the splitpane to the xamDockManager's splitpane, etc.
create a SplitPane, set its InitializePaneLocation to DockedLeft, add the ContentPane to its Panes collection, add the splitpane to the xamDockManager's splitpane, etc
can u please state the code for the same.
after creating the SplitPane, i am not able to get the property "InitializePaneLocation".
Oops. I meant InitialPaneLocation. This is an attached property on xamDockManager just like you would set via xaml so it would be something like XamDockManager.SetInitialPaneLocation(...
I am unable to find the method SetInitialPaneLocation on xamDockManger you mention. Can you attach an example by chance?
There are example snippets in the help file that utilize this method. E.g. http://help.infragistics.com/Help/NetAdvantage/WPF/2009.1/CLR3.X/html/Infragistics3.Wpf.DockManager.v9.1~Infragistics.Windows.DockManager.XamDockManager.html
I have this same issue in Silverlight (2011.1). The link you provided does not work. Was this resolved?
Only the last couple of releases are kept online so the version at the time 2 years ago is no longer online. The same page is available for the newer releases but since your question is about the Silverlight control it would best if you posted your question the SL XamDockManager forum.