Back to Devexpress

DiagramControl.SaveDocument(Stream) Method

wpf-devexpress-dot-xpf-dot-diagram-dot-diagramcontrol-dot-savedocument-x28-system-dot-io-dot-stream-x29.md

latest2.9 KB
Original Source

DiagramControl.SaveDocument(Stream) Method

Saves the current diagram document to a stream.

Namespace : DevExpress.Xpf.Diagram

Assembly : DevExpress.Xpf.Diagram.v25.2.dll

NuGet Package : DevExpress.Wpf.Diagram

Declaration

csharp
public void SaveDocument(
    Stream stream
)
vb
Public Sub SaveDocument(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

A stream to which to save the diagram document.

|

Remarks

A diagram can be saved to an XML file and then loaded from this file at design time and runtime.

Use the DiagramControl.LoadDocument method to load a diagram from a file.

Handle the DiagramControl.CustomSaveDocument and DiagramControl.CustomLoadDocument events to implement custom logic for loading and saving diagrams.

The DiagramContentItem.Content property that defines items with custom content is serialized by default, provided that its content supports serialization. Simple types are supported out of the box. Custom types should be marked with the SerializableAttribute. See the Value types article for more information.

To enable serialization for custom item types, use the DevExpress.Diagram.Core.DiagramItemTypeRegistrator.Register method. To modify the list of serialized properties, use the DiagramControl.CustomGetSerializableItemProperties event. Alternatively, mark the additional properties of a custom item type with the DevExpress.Utils.Serializing.XtraSerializableProperty attribute.

See Also

LoadDocument

DiagramControl Class

DiagramControl Members

DevExpress.Xpf.Diagram Namespace