バージョン

SaveLayout() メソッド

ペインの現在の配置に関する情報を保存し、それを文字列で返します。
シンタックス
'宣言
 
Public Overloads Function SaveLayout() As String
public string SaveLayout()

戻り値の型

レイアウト情報を含む文字列。
例外
例外解説
System.InvalidOperationExceptionSaveInLayout が True になっている ContentPane の「Name」プロパティが設定されていないか、もしくは、保存される他のコンテンツ ペインと区別できない名前です。
使用例
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>
参照