This documentation is archived and is not being maintained.

Floater Class

Provides an inline-level flow content element used to host a floater. A floater displays images and other content parallel to the main content flow in a FlowDocument.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public class Floater : AnchoredBlock
public class Floater extends AnchoredBlock
public class Floater extends AnchoredBlock

Content Model: Floater enforces a strong content model for child content. See TextElement Content Model Overview for more information about the Floater content model.

Figure or Floater elements are often used to highlight or accentuate portions of content, to host supporting images or other content within the main content flow, or to inject loosely related content such as advertisements.

Figure and Floater differ in several ways and are used for different scenarios.


  • Can be positioned: You can set its horizontal and vertical anchors to dock it relative to the page, content, column or paragraph. You can also use its HorizontalOffset and VerticalOffset properties to specify arbitrary offsets.

  • Is sizable to more than one column: You can set Figure height and width to multiples of page, content or column height or width. Note that in the case of page and content, multiples greater than 1 are not allowed. For example, you can set the width of a Figure to be "0.5 page" or "0.25 content" or "2 Column". You can also set height and width to absolute pixel values.

  • Does not paginate: If the content inside a Figure does not fit inside the Figure, it will render whatever content does fit and the remaining content is lost


  • Cannot be positioned and will render wherever space can be made available for it. You cannot set the offset or anchor a Floater.

  • Cannot be sized to more than one column: By default, Floater sizes at one column. It has a Width property that can be set to an absolute pixel value, but if this value is greater than one column width it is ignored and the floater is sized at one column. You can size it to less than one column by setting the correct pixel width, but sizing is not column-relative, so "0.5Column" is not a valid expression for Floater width. Floater has no height property and it's height cannot be set, it’s height depends on the content

  • Floater paginates: If its content at its specified width extends to more than 1 column height, floater breaks and paginates to the next column, the next page, etc.

Figure is a good place to put standalone content where you want to control the size and positioning, and are confident that the content will fit in the specified size. Floater is a good place to put more free-flowing content that flows similar to the main page content, but is separated from it.

The following example defines a FlowDocument that contains both Floater and Figure elements.

    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.
        <!-- This Figure uses relative measurements for width and height. -->
          Width="0.25" Height="0.1" Background="GhostWhite" 
          HorizontalOffset="100" VerticalOffset="20"
            FontStyle="Italic" TextAlignment="Left"
            Background="Beige" Foreground="DarkGreen"
            Neptune has 72 times Earth's volume...
        <!-- This Floater uses relative measurements for width. -->
          Width="0.4" 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.

The following illustration shows how this example renders.

Screenshot: Floaters and Figures in a FlowDocument


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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0