Loads a layout saved with the
SaveLayout method.
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
'Declaration
Public Overloads Sub LoadLayout( _
ByVal As String _
)
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);
}
'Declaration
Public Overloads Sub LoadLayout( _
ByVal As String _
)
<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>
'Declaration
Public Overloads Sub LoadLayout( _
ByVal As String _
)
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