This documentation is archived and is not being maintained.

FlowDocumentPageViewer Class

Represents a control for viewing flow content in a fixed viewing mode that shows content one page at a time.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

[TemplatePartAttribute(Name = "PART_FindToolBarHost", Type = typeof(Decorator))]
public class FlowDocumentPageViewer : DocumentViewerBase

Content Model: FlowDocumentPageViewer allows only one FlowDocument as a child element.

FlowDocumentPageViewer shows content in page-at-a-time viewing mode. A similar control, FlowDocumentScrollViewer, shows content in continuous scrolling mode. Both FlowDocumentPageViewer and FlowDocumentScrollViewer are fixed to a particular viewing mode. On the other hand, FlowDocumentReader includes features that enable the user to dynamically choose between various viewing modes (as provided by the FlowDocumentReaderViewingMode enumeration), at the cost of being poorer performing than FlowDocumentPageViewer or FlowDocumentScrollViewer.

The following illustration shows a FlowDocumentPageViewer control with its default user interface (UI).

Screenshot: FlowDocumentPageViewer
  • Content Area - The content area displays the contents of the FlowDocument specified by the Document property.

  • Toolbar - The default toolbar is docked underneath the content area, and hosts controls for navigating pages, and changing the zoom level.

    • Page Navigation Controls - The page navigation controls include a button to jump to the next page (the down arrow) or previous page (the up arrow), as well as indicators for the current page number and total number of pages.

    • Zoom Controls - The zoom controls enable the user to increase or decrease the zoom level by clicking the plus or minus buttons, respectively. The zoom controls also include a slider for adjusting the zoom level. For more information, see Zoom.

    • Search - The user can use the Ctr+F keyboard shortcut or you can use Find to toggle a search textbox that is used to find strings within the content. See Find for more information.

The following example defines the FlowDocumentPageViewer pictured in the figure above.

<FlowDocumentPageViewer Margin="10" BorderBrush="Black" BorderThickness="1">
    IsOptimalParagraphEnabled="True" IsHyphenationEnabled="True"
    <Section FontSize="12">
        <Bold>Neptune</Bold> (planet), major planet in the solar system, eighth planet
        from the Sun and fourth largest in diameter.  Neptune maintains an almost constant
        distance, about 4,490 million km (about 2,790 million mi), from the Sun.  Neptune
        revolves outside the orbit of Uranus and for most of its orbit moves inside the
        elliptical path of the outermost planet Pluto (see Solar System). Every 248 years,
        Pluto’s elliptical orbit brings the planet inside Neptune’s nearly circular orbit
        for about 20 years, temporarily making Neptune the farthest planet from the Sun.
        The last time Pluto’s orbit brought it inside Neptune’s orbit was in 1979. In
        1999 Pluto’s orbit carried it back outside Neptune’s orbit.
          Width="140" Height="50" Background="GhostWhite" 
          HorizontalOffset="100" VerticalOffset="20"
            FontStyle="Italic" TextAlignment="Left"
            Background="Beige" Foreground="DarkGreen"
            Neptune has 72 times Earth's volume...

          Width="285" HorizontalAlignment="Left"
          <Table CellSpacing="5">
              <TableColumn Width="155"/>
              <TableColumn Width="130"/>

                <TableCell ColumnSpan="3">
                  <Paragraph>Neptune Stats</Paragraph>

              <TableRow Background="LightGoldenrodYellow" FontSize="12">
                  <Paragraph FontWeight="Bold">Mean Distance from Sun</Paragraph>
                  <Paragraph>4,504,000,000 km</Paragraph>

              <TableRow FontSize="12" Background="LightGray">
                  <Paragraph FontWeight="Bold">Mean Diameter</Paragraph>
                  <Paragraph>49,532 km</Paragraph>

              <TableRow Background="LightGoldenrodYellow" FontSize="12">
                  <Paragraph FontWeight="Bold">Approximate Mass</Paragraph>
                  <Paragraph>1.0247e26 kg</Paragraph>
                <TableCell ColumnSpan="4">
                  <Paragraph FontSize="10" FontStyle="Italic">
                    Information from the
                    web site.
        Astronomers believe Neptune has an inner rocky core that is surrounded by a vast
        ocean of water mixed with rocky material. From the inner core, this ocean extends
        upward until it meets a gaseous atmosphere of hydrogen, helium, and trace amounts
        of methane. Neptune has four rings and 11 known moons. Even though Neptune's volume
        is 72 times Earth’s volume, its mass is only 17.15 times Earth’s mass. Because of
        its size, scientists classify Neptune—along with Jupiter, Saturn, and Uranus—as
        one of the giant or Jovian planets (so-called because they resemble Jupiter).
          Width="140" Height="50" 
          Background="GhostWhite" TextAlignment="Left" 
          HorizontalAnchor="PageCenter" WrapDirection="Both"
          <Paragraph FontStyle="Italic" Background="Beige" Foreground="DarkGreen" >
            Neptune has an orbital period of ~20 years...
        Mathematical theories of astronomy led to the discovery of Neptune. To account for
        wobbles in the orbit of the planet Uranus, British astronomer John Couch Adams and
        French astronomer Urbain Jean Joseph Leverrier independently calculated the existence
        and position of a new planet in 1845 and 1846, respectively. They theorized that the
        gravitational attraction of this planet for Uranus was causing the wobbles in Uranus’s
        orbit. Using information from Leverrier, German astronomer Johann Gottfried Galle first
        observed the planet in 1846.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0