windowsforms-devexpress-dot-utils-dot-baseappearancecollection-dot-savelayouttostream-x28-system-dot-io-dot-stream-x29.md
Saves the appearance settings to a specific stream.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
public virtual void SaveLayoutToStream(
Stream stream
)
Public Overridable Sub SaveLayoutToStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A Stream descendant to which the appearance settings are written.
|
Use the SaveLayoutToStream method to write the activated appearance settings to a stream. The appearance settings are activated if their corresponding options are enabled. You can then read the saved settings using the BaseAppearanceCollection.RestoreLayoutFromStream method.
The following sample code saves the appearance settings used to paint the XtraGrid’s elements to a memory stream and then restores them.
System.IO.Stream str;
str = new System.IO.MemoryStream();
gridControl1.MainView.Appearance.SaveLayoutToStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
// ...
gridControl1.MainView.Appearance.RestoreLayoutFromStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
Dim str As System.IO.Stream
str = New System.IO.MemoryStream()
GridControl1.MainView.Appearance.SaveLayoutToStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)
' ...
GridControl1.MainView.Appearance.RestoreLayoutFromStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)
See Also
RestoreLayoutFromStream(Stream)
Save and Restore Layouts of DevExpress controls
BaseAppearanceCollection Class