LayoutControl.SaveLayoutToStream(Stream) Method

Saves the current layout to the specified stream.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v20.1.dll

Declaration

public virtual void SaveLayoutToStream(
    Stream stream
)
Public Overridable Sub SaveLayoutToStream(
    stream As Stream
)

Parameters

Name Type Description
stream Stream

A Stream descendant to which the current layout is written.

Remarks

Use the SaveLayoutToStream method to write the current layout to a stream. The layout can then be read using the LayoutControl.RestoreLayoutFromStream method.

See Save and Restore Layout to learn more.

TIP

You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.

Examples

The following sample code saves the current layout to a memory stream and then restores it.

System.IO.Stream stream;
stream = new System.IO.MemoryStream();
layoutControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
layoutControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

Implements

DevExpress.XtraLayout.ILayoutControl.SaveLayoutToStream(Stream)
DevExpress.Utils.Serializing.ISupportXtraSerializer.SaveLayoutToStream(Stream)
See Also