Property Value

Starting in the .NET Framework 4, the Text property of the Run object is a dependency property, which means that you can bind the Text property to a data source. The Text property fully supports one-way binding in FlowDocumentReader and other controls that display read-only text. For more information about data binding, see Data Binding Overview.

Note

Binding text to a Run object contained within RichTextBox is not supported. Editing operations within the RichTextBox may cause the binding to be cleared.

<StackPanel><StackPanel.Resources><TextBoxx:Key="DataStore"Text="This is an example of text flow using bound run"/></StackPanel.Resources><FlowDocumentReader><FlowDocument><Paragraph><RunText="This is an example of Run"/></Paragraph><Paragraph><RunText="{Binding Source={StaticResource DataStore}, Path=Text}"/></Paragraph></FlowDocument></FlowDocumentReader></StackPanel>