Exception | Description |
---|---|
System.InvalidOperationException | The layout cannot be loaded if the dockmanager is in an operation that doesn't allow it such as when a pane or tool window is being dragged. You should use the LoadLayout overload that takes a boolean for the 'processAsyncIfNeeded' parameter with a value of true or wait for the IsLoadLayoutAllowed to return true. |
Note: If the IsLoadLayoutAllowed is false then an exception will be thrown. To have the layout be automatically loaded when the blocking operation is complete, use the LoadLayout(Stream,Boolean) and pass true to allow the load to occur asynchronously.
Imports Infragistics.Windows.DockManager Private Const LayoutPath As String = "C:\layout.xml" Private Sub mnuSaveToFile_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Using stream As System.IO.Stream = New System.IO.FileStream(LayoutPath, System.IO.FileMode.Create) Me.dmLoadFile.SaveLayout(stream) End Using End Sub Private Sub mnuLoadFromFile_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) If System.IO.File.Exists(LayoutPath) Then Using stream As System.IO.Stream = New System.IO.FileStream(LayoutPath, System.IO.FileMode.Open) Me.dmLoadFile.LoadLayout(stream) End Using End If End Sub
using Infragistics.Windows.DockManager; private const string LayoutPath = @"C:\layout.xml"; private void mnuSaveToFile_Click(object sender, RoutedEventArgs e) { using (System.IO.Stream stream = new System.IO.FileStream(LayoutPath, System.IO.FileMode.Create)) this.dmLoadFile.SaveLayout(stream); } private void mnuLoadFromFile_Click(object sender, RoutedEventArgs e) { if (System.IO.File.Exists(LayoutPath)) { using (System.IO.Stream stream = new System.IO.FileStream(LayoutPath, System.IO.FileMode.Open)) this.dmLoadFile.LoadLayout(stream); } }
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