Try it: Create a FlowDocumentReader control
In the Properties panel, some properties are more complex than a single value. For example, some properties represent a collection of values, or represent an object with properties of its own. You can use the collection editor and the subproperty editor to modify these values.
The following procedure uses the subproperty and collection editors to show you how to add content to a FlowDocumentReader control.
The FlowDocumentReader control is available from the Assets panel. In the Tools panel, click Assets .
In the Controls category, click All to see all the available controls.
Select the FlowDocumentReader control from the list of controls. A generic icon appears underneath the Assets button in the Tools panel, selected and ready to be added to the artboard.
Draw a FlowDocumentReader on the artboard.
With the FlowDocumentReader object selected in the Objects and Timeline panel, expand the Miscellaneous category in the Properties panel.
Click the New button next to the Document property. The Document property is populated with a FlowDocument object, and the subproperty editor for the FlowDocument opens. You can expand and collapse the subproperty editor. The Document property can contain only one FlowDocument.
Properties that will display a subproperty editor are typically identified by a New button next to them, and an expander arrow (if the property has content). If the property has default subproperties associated with them, a drop-down arrow will also appear next to the property. For example, the BitmapEffect property provides a drop-down list that includes the BevelBitmapEffect, BlurBitmapEffect, and other subproperties that you can select from.
In the subproperty editor for the Document property, click the Edit items in this collection button next to the Blocks (Collection) property. The collection editor opens for the Blocks property.
Properties that will display a collection editor are typically identified by the word (Collection) next to the property name, and by an Edit items in this collection button.
In the collection editor for the Blocks subproperty, click the Add another item button. The Select Object window appears, from which you can select any Windows Presentation Foundation (WPF) object.
In the Search text box, type Paragraph to quickly locate the Paragraph class. Select Paragraph from the list under System.Windows.Documents, and then click OK. The Select Object window closes, and a Paragraph item is added to the collection editor at index 0. The properties of the Paragraph object are displayed on the right side.
It can be difficult to understand which objects are valid for a given collection. For collection properties of common controls (such as the Items collection property of the ListBox control), the collection editor provides a drop-down list of suggested items in addition to the Add another item button. However, for less common controls (such as the FlowDocumentReader control), if might help you understand which elements are valid for the collection to view the MSDN documentation for the control type. For example, in the Flow Related Classes section of the Flow Document Overview on MSDN, a diagram shows the structure of flow document controls. From that diagram, you can see that the Blocks property can contain a Paragraph, Section, List, Table, and/or a BlockUIContainer element. In the following steps, you will add a Run element to the Inlines collection property of the Paragraph object.
In the Properties window of the Paragraph object, click the Edit items in this collection button next to the Inlines property. The collection editor switches to the scope of the Inlines property.
Click the Add another item button, and then select the Run class from the Select Object window. A Run object has been added to the collection editor at index 0.
In the Properties window of the Run object, add content by typing in the Text property. You can also use some of the properties of the Brushes and Text categories to style the text. Other properties are disabled because they have to be set at the level of the FlowDocumentViewer control.
Click OK to exit the collection editor for the Inlines property, and then click OK to exit the collection editor of the Blocks property. The text that you entered in the previous step is displayed in the FlowDocumentViewer control.
Do not click the New button next to the Document property of the FlowDocumentViewer object unless you want to delete the content that you just created, because the Document property can contain only one FlowDocument object. Unless a property name includes the word (Collection), the property can contain only a single object.
If you are editing a FlowDocumentScrollViewer or a RichTextBox object, you can use the Microsoft Expression Blend text editor, which can be accessed by selecting the object and then pressing F2. For more information, see Edit text. If you are editing a DocumentViewer or a FlowDocumentPageViewer object, content is added programmatically. For more information, see Flow Document Overview and Documents in Windows Presentation Foundation on MSDN. Also see the DocumentViewer Samples and FlowDocumentReader Samples that you can download from Windows SDK .NET Framework 3.0 Samples.