--- name: creating-wpf-flowdocument description: Creates WPF FlowDocument for rich text display with Paragraph, Table, List elements. Use when building document viewers, rich text editors, or printable reports. --- # WPF FlowDocument Patterns Creating rich, paginated documents with flowing text content. **Advanced Patterns:** See [ADVANCED.md](ADVANCED.md) for programmatic creation, printing, and file I/O. ## 1. FlowDocument Overview ``` FlowDocument ├── Block Elements (Paragraph, Section, List, Table, BlockUIContainer) │ └── Inline Elements (Run, Bold, Italic, Hyperlink, InlineUIContainer) ├── Viewers │ ├── FlowDocumentScrollViewer (continuous scroll) │ ├── FlowDocumentPageViewer (page by page) │ └── FlowDocumentReader (multiple viewing modes) └── Features ├── Automatic pagination ├── Column layout ├── Figure/Floater positioning └── Print support ``` --- ## 2. Basic FlowDocument ### 2.1 Simple Document ```xml Document Title This is a paragraph with bold, italic, and underlined text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. ``` ### 2.2 Document Properties ```xml ``` --- ## 3. Block Elements ### 3.1 Paragraph ```xml Regular paragraph text with indentation. Highlighted paragraph with background. ``` ### 3.2 Section (Grouping) ```xml
First paragraph in section. Second paragraph in section. All paragraphs inherit section styling.
``` ### 3.3 List ```xml First item Second item Nested item 1 Nested item 2 Step one Step two ``` **MarkerStyle Options:** None, Disc, Circle, Square, Box, LowerRoman, UpperRoman, LowerLatin, UpperLatin, Decimal ### 3.4 Table ```xml Name Description Price Item 1 Description of item 1 $10.00
``` ### 3.5 BlockUIContainer (Embedding UI) ```xml