Hi.
I have a SplitPane on the left size of the window, set to 'autohide'.
I would like to save the 'width' of the panel when the user exit the application and set it again when opening.
However, I could not find any property that changes in the SplitPane after I manually drag the panel.
How can I get the CURRENT width of the panel?
Note that I did checked the Width, ActualWidth for the SplitPane, its child/parent and XamDockManager.GetFloatingSize as well as the SplitPane.GetRelativeSize
What am I missing?
5228.TestSample.zip
Hello Eli,
Thank you for contacting. We have 'SaveLayout' and 'LoadLayout' methods which you can use to save/load the 'width' of the panel when the user exit the application.
You can refer to this online help doc for more information:www.infragistics.com/.../xamdockmanager-save-an-end-users-docking-layout
Also I was expecting ActualWidth would also help you to provide you the width of the split pane.
Set up a small demo sample for your reference.
Regards,Divya Jain
Thank you. I am aware that the dockmanager contain Load/Save for layout, however, due to the nature of my application, I only want to set the floating panels layout without changing the other elments. I've seen that the XML contain the parameters extent and extentflayout which seems to be exactly the correct parameters I need. however, I could not find a way to Get/Set them - any suggestions?
Hello,
Thank you for the update. Looking into the API I don’t see extentflayout so these are something internal, not exposed for public use .
Although again you can still use the ActualWidth and ActualHeight property to set it back, its just you need to find the floating pane.
I tried this on button click in my previous sample and its working fine:
private void Button_ClickSave(object sender, RoutedEventArgs e) { foreach (SplitPane splitpane in this.xamDockManager1.Panes) { //var p = this.xamDockManager1.Panes[x]; foreach (var pane in splitpane.Panes) { if (pane is TabGroupPane) { var x = pane as TabGroupPane; foreach (var y in x.Items) { ContentPane cp = null; if(y is ContentPanePlaceholder) { cp = (y as ContentPanePlaceholder).Pane; } else if(y is ContentPane) { cp = y as ContentPane; } if (cp != null && (cp.PaneLocation== PaneLocation.Floating || cp.PaneLocation == PaneLocation.FloatingOnly)) { var width= cp.ActualWidth; var height = cp.ActualHeight; } } } else if (pane is ContentPane) { ContentPane cp = pane as ContentPane; if (cp.PaneLocation == PaneLocation.Floating || cp.PaneLocation == PaneLocation.FloatingOnly) { var width = cp.ActualWidth; var height = cp.ActualHeight; } } } } //using (FileStream fs = new FileStream("layout.xml", FileMode.Create, FileAccess.Write)) //{ // this.xamDockManager1.SaveLayout(fs); //} }
Regards,
Divya Jain
Thank you, this covers what I was looking for.