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(String,Boolean) and pass true to allow the load to occur asynchronously.
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); }
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