DXRichEditBehaviorOptions.KeepStreamInDocumentSource Property

Specifies whether to retain the reference to the stream from which the document is loaded as the RichEditControl.DocumentSource property value. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v20.1.dll


public bool KeepStreamInDocumentSource { get; set; }
Public Property KeepStreamInDocumentSource As Boolean

Property Value

Type Description

true, to update the RichEditControl.DocumentSource property to contain the stream reference; otherwise, false.

The default value is false.

Property Paths

You can access this nested property as listed below:

Object Type Path to KeepStreamInDocumentSource


When the document is loaded from a stream using one the RichEditControl.LoadDocument method overrides, the RichEditControl.DocumentSource property does not reference the Stream instance, but contains the StreamSource object instead. This behavior allows you to safely reduce the stream by the garbage collector.

To change this behavior and keep the stream reference as a RichEditControl.DocumentSource property value, set KeepStreamInDocumentSource to true. Note that in this case, the garbage collector will not be able to collect the target Stream instance.


If the RichEditControl.DocumentSource is set to a stream directly, it will contain the stream reference regardless of the KeepStreamInDocumentSource value.

See Also