wpf-devexpress-dot-xpf-dot-docking-dot-docklayoutmanager-dot-savelayouttoxml-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Saves the layout of dock panes to an XML file.
Namespace : DevExpress.Xpf.Docking
Assembly : DevExpress.Xpf.Docking.v25.2.dll
NuGet Package : DevExpress.Wpf.Docking
public void SaveLayoutToXml(
string path
)
Public Sub SaveLayoutToXml(
path As String
)
| Name | Type | Description |
|---|---|---|
| path | String |
An XML file to which the layout is stored.
|
The saved layout can be restored using the DockLayoutManager.RestoreLayoutFromXml method.
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 SaveLayoutToXml(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#L14
private void OnSaveButtonClick(object sender, System.Windows.RoutedEventArgs e) {
manager.SaveLayoutToXml(LayoutFileName);
}
(dockLayoutManager.DataContext as MainViewModel).SaveDocsInfo(docPath);
dockLayoutManager.SaveLayoutToXml(path);
}
wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/VB/MainWindow.xaml.vb#L17
Private Sub OnSaveButtonClick(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
Me.manager.SaveLayoutToXml(LayoutFileName)
End Sub
TryCast(Me.dockLayoutManager.DataContext, MainViewModel).SaveDocsInfo(docPath)
Me.dockLayoutManager.SaveLayoutToXml(path)
End Sub
See Also
RestoreLayoutFromStream(Stream)
SaveLayoutToXml(String)