ComponentOne RichTextBox for WPF
In This Topic
    Working with the C1Document Object
    In This Topic

    So far we have focused on the object model of the C1RichTextBox control. But the control is just an editable view of a C1Document object, which exposes a rich object model for creating and editing the underlying document. This architecture is similar to the one used by the Microsoft WPF RichTextBox control, which provides a view of a FlowDocument object.

    Programming directly against the C1Document object is the best way to perform many tasks, including report generation and the implementation of import and export filters. For example, the Html property exposes an HTML filter with methods that convert C1Document objects to and from HTML strings. You could implement a similar filter class to import and export other popular formats such as RTF or PDF.

    The C1RichTextBox deals mainly with text. It provides a flat, linear view of the control content. The C1Document, on the other hand, exposes the structure of the document. The document model makes it easy to enumerate the runs within each paragraph, items within each list, and so on. This will be shown in a later section.

    See Also