windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-dot-savelayouttostream-x28-system-dot-io-dot-stream-x29.md
Saves the layout of dock panels to a stream.
Namespace : DevExpress.XtraBars.Docking
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual void SaveLayoutToStream(
Stream stream
)
Public Overridable Sub SaveLayoutToStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A Stream descendant to which the layout of dock panels is written.
|
After the layout of dock panels has been saved using the SaveLayoutToStream method it can then be restored using the DockManager.RestoreLayoutFromStream method.
For more information, see Saving and Restoring the Layout of Dock Panels
Tip
You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.
The following code demonstrates how to write and read the docking layout to and from memory.
System.IO.Stream stream = new System.IO.MemoryStream();
dockManager1.SaveLayoutToStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);
// ...
dockManager1.RestoreLayoutFromStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);
Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
DockManager1.SaveToStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)
' ...
DockManager1.RestoreFromStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SaveLayoutToStream(Stream) 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.
xaf-how-to-create-information-panels/VB/InfoPanels.Module.Win/MainForm.vb#L72
Dim stream As MemoryStream = New MemoryStream()
DockManager.SaveLayoutToStream(stream)
ModelTemplate.DockManagerSettings = Encoding.UTF8.GetString(stream.ToArray())
See Also