Back to Devexpress

DockLayoutManager.SaveLayoutToXml(String) Method

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

latest4.4 KB
Original Source

DockLayoutManager.SaveLayoutToXml(String) Method

SECURITY-RELATED CONSIDERATIONS

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

Declaration

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

Parameters

NameTypeDescription
pathString

An XML file to which the layout is stored.

|

Remarks

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

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

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

csharp
(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

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

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

vb
TryCast(Me.dockLayoutManager.DataContext, MainViewModel).SaveDocsInfo(docPath)
    Me.dockLayoutManager.SaveLayoutToXml(path)
End Sub

See Also

RestoreLayoutFromStream(Stream)

RestoreLayoutFromXml(String)

SaveLayoutToStream(Stream)

SaveLayoutToXml(String)

DockLayoutManager Class

DockLayoutManager Members

DevExpress.Xpf.Docking Namespace