Back to Devexpress

DockLayoutManager.RestoreLayoutFromXml(String) Method

wpf-devexpress-dot-xpf-dot-docking-dot-docklayoutmanager-dot-restorelayoutfromxml-x28-system-dot-string-x29.md

latest4.3 KB
Original Source

DockLayoutManager.RestoreLayoutFromXml(String) Method

SECURITY-RELATED CONSIDERATIONS

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the layout of dock panes from an XML file.

Namespace : DevExpress.Xpf.Docking

Assembly : DevExpress.Xpf.Docking.v25.2.dll

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public void RestoreLayoutFromXml(
    string path
)
vb
Public Sub RestoreLayoutFromXml(
    path As String
)

Parameters

NameTypeDescription
pathString

An XML file that contains the layout of dock panes.

|

Remarks

See Saving and Restoring the Layout of Dock Panels and Controls to learn more.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RestoreLayoutFromXml(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/CS/MainWindow.xaml.cs#L17

csharp
private void OnRestoreButtonClick(object sender, System.Windows.RoutedEventArgs e) {
    manager.RestoreLayoutFromXml(LayoutFileName);
}

wpf-docklayoutmanager-serialize-docklayoutmanager-when-tabbeddocumentuiservice-is-used/CS/MainWindow.xaml.cs#L22

csharp
(dockLayoutManager.DataContext as MainViewModel).RestoreDocsInfo(docPath);
    dockLayoutManager.RestoreLayoutFromXml(path);
}

wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/VB/MainWindow.xaml.vb#L21

vb
Private Sub OnRestoreButtonClick(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
    Me.manager.RestoreLayoutFromXml(LayoutFileName)
End Sub

wpf-docklayoutmanager-serialize-docklayoutmanager-when-tabbeddocumentuiservice-is-used/VB/MainWindow.xaml.vb#L30

vb
TryCast(Me.dockLayoutManager.DataContext, MainViewModel).RestoreDocsInfo(docPath)
    Me.dockLayoutManager.RestoreLayoutFromXml(path)
End If

See Also

RestoreLayoutFromStream(Stream)

RestoreLayoutFromXml(String)

SaveLayoutToStream(Stream)

SaveLayoutToXml(String)

DockLayoutManager Class

DockLayoutManager Members

DevExpress.Xpf.Docking Namespace