#254 – Types of Containers for Hosting a FlowDocument

There are four different controls that you can use to host a FlowDocument:

  • FlowDocumentReader – Reader with support for multiple columns, paging, find and zooming
  • FlowDocumentPageViewer – Reader with support for multiple columns, paging and zooming
  • RichTextBox – Content displayed in an editable format
  • FlowDocumentScrollViewer – Content displayed  with a vertical scrollbar

Here are screenshots of each of the containers:

Advertisement

#253 – FlowDocument is Hosted in a FlowDocumentReader Automatically

Because FlowDocument does not derive from UIElement, you can’t include it in a Panel control.  You can use a FlowDocument as the main content in any ContentControl.  If you do this, the FlowDocument will automatically be hosted in a FlowDocumentReader.

The FlowDocumentReader displays some portion of a FlowDocument and provides controls to either page or scroll through the rest of the document.  It also supports displaying the document in multiple columns and provides an easy way to adjust the font size.

The image below shows a FlowDocumentReader hosting a FlowDocument.

The various widgets on the toolbar at the bottom are described below.

  • Find text within the document    
  • Navigate between pages  
  • Single Page / Double Page / Scrolling  
  • Zoom (make text larger)