Version

SaveLayout() Method

Saves information about the current arrangement of the panes and returns that as a string.
Syntax
'Declaration
 
Public Overloads Function SaveLayout() As String
public string SaveLayout()

Return Value

A string that contains the layout information.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionThe 'Name' property of a ContentPane whose SaveInLayout is true has not been set or is not unique with respect to the other content panes being saved.
Example
This example demonstrates how to use the overloads of SaveLayout and LoadLayout that deal with a string to restore the state of a XamDockManager.

Imports Infragistics.Windows.DockManager

Private _originalLayout As String

Private Sub dmResetLayout_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' save the original layout when the dockmanager was first 
    ' loaded so we can restore it later 
    Dim dm As XamDockManager = TryCast(sender, XamDockManager)
    Me._originalLayout = dm.SaveLayout()
End Sub

Private Sub mnuResetLayout_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Me.dmResetLayout.LoadLayout(Me._originalLayout)
End Sub
using Infragistics.Windows.DockManager;

private string _originalLayout;

private void dmResetLayout_Loaded(object sender, RoutedEventArgs e)
{
	// save the original layout when the dockmanager was first
	// loaded so we can restore it later
	XamDockManager dm = sender as XamDockManager;
	this._originalLayout = dm.SaveLayout();
}

private void mnuResetLayout_Click(object sender, RoutedEventArgs e)
{
	this.dmResetLayout.LoadLayout(this._originalLayout);
}
<DockPanel>
    
<Menu DockPanel.Dock="Top">
        
<MenuItem Header="File">
            
<MenuItem x:Name="mnuResetLayout" Header="Reset Window Layout" Click="mnuResetLayout_Click" />
        
</MenuItem>
    
</Menu>
    
<!-- The Name property for all ContentPanes to be saved must be set. -->
    
<igDock:XamDockManager x:Name="dmResetLayout" Loaded="dmResetLayout_Loaded">
        
<igDock:XamDockManager.Panes>
            
<igDock:SplitPane x:Name="splitToolbox2" 
                              
igDock:XamDockManager.InitialLocation="DockedLeft">
                
<igDock:ContentPane x:Name="paneToolbox2" Header="Toolbox" />
            
</igDock:SplitPane>
            
<igDock:SplitPane x:Name="splitFind2"
                
igDock:XamDockManager.FloatingSize="100,40"
                
igDock:XamDockManager.InitialLocation="FloatingOnly">
                
<igDock:ContentPane x:Name="paneFind2" 
                                    
Header="Find and Replace" />
            
</igDock:SplitPane>
            
<igDock:SplitPane x:Name="splitRight2"
                              
igDock:XamDockManager.InitialLocation="DockedRight">
                
<igDock:TabGroupPane x:Name="tabTrees2">
                    
<igDock:ContentPane x:Name="paneSolution2" 
                                        
Header="Solution Explorer" />
                    
<igDock:ContentPane x:Name="paneClassView2" 
                                        
Header="Class View" 
                                        
IsPinned="False" />
                
</igDock:TabGroupPane>
            
</igDock:SplitPane>
            
<igDock:SplitPane x:Name="splitOutput2" 
                              
igDock:XamDockManager.FloatingSize="100,40"
                              
igDock:XamDockManager.InitialLocation="DockableFloating">
                
<igDock:ContentPane x:Name="paneOutput2" 
                                    
Header="Output" />
            
</igDock:SplitPane>
        
</igDock:XamDockManager.Panes>
        
<igDock:DocumentContentHost>
            
<igDock:SplitPane x:Name="rootDocSplit2">
                
<igDock:TabGroupPane x:Name="mainGroup2">
                    
<igDock:ContentPane x:Name="file1a" Header="File 1" />
                    
<igDock:ContentPane x:Name="file2a" Header="File 2" />
                
</igDock:TabGroupPane>
            
</igDock:SplitPane>
        
</igDock:DocumentContentHost>
    
</igDock:XamDockManager>
</DockPanel>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also