RichEditControl.DocumentSource Property

Gets or sets a document supplier for RichEditControl. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

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

Declaration

public object DocumentSource { get; set; }
Public Property DocumentSource As Object

Property Value

Type Description
Object

A Object that is the document source.

Remarks

The DocumentSource allows you to bind the RichEditControl to a document source from XAML. The RichEditControl supports the following data sources:

TIP

Set the DocumentSource property to the RichEditDocumentSource instance to set a strict format to the source document.

The DocumentSource is updated when the document is loaded by calling RichEditControl.LoadDocument or Document.LoadDocument methods, or by executing the LoadDocumentCommand.

If the document is created or loaded from a file or a stream using one of the File methods, the DocumentSource is updated to contain the path to this document.

When the document is loaded from a stream, the DocumentSource property doesn't reference the used stream, but contains the StreamSource instance instead. As a result, the stream can be safely reduced by the garbage collector.

Set the DXRichEditBehaviorOptions.KeepStreamInDocumentSource property to true to change this behavior and pass the stream reference to the DocumentSource property. Note that in this case, the garbage collector will not be able to collect the stream.

You can use the DXBinding extension to call a method that returns a valid document source directly in XAML, as in the following code:

<dxre:RichEditControl  Name="richEditControl1" CommandBarStyle="Ribbon" DocumentSource="{DXBinding '$local:SourceHelper.GetDocumentSource()'}">
</dxre:RichEditControl>
IMPORTANT

The format of an encrypted file cannot be detected. Use the RichEditDocumentSource instance to bind an encrypted file.

See Also