Difference between Figures and Floaters!!

A Figure is very similar to Floaters but for the following differences

  • Figure can be positioned relative to the page to which it is anchored (e.g. positioned at the bottom of the page); Floater is always positioned parallel to the main flow
  • Figure can span across multiple columns; Floater is constrained to a single column

So in that sense, we could say that Figure and Floaters complement one another. Now lets have a look at how it looks like:

Image hosted by Photobucket.com

The Xaml code for the above looks like this:

 <FlowDocument xmlns="https://schemas.microsoft.com/winfx/avalon/2005" 
xmlns:x="https://schemas.microsoft.com/winfx/xaml/2005" TextAlignment="Left"> 
<Paragraph>  
 Hundreds of video game fans waited in line in chilly weather across the U.S. ...
 <Figure BorderBrush="black" BorderThickness="2"   VerticalAnchor="PageTop" Width="Content" >   
  <Paragraph>    
   <Image Source="e:\xbox.bmp" Height="100"/>   
  </Paragraph>  
 </Figure >   
 They may be the lucky ones. Most stores quickly sold out of their limited supply and prices
 for the console on eBay topped $2,000. ...
 </Paragraph> 
</FlowDocument>

 

Looks familiar ..yeah!! but there are some differences from the image you seen in the previous posting. The image is at the top of the paragraph and its width is the paragraph width. Now this is because the values are set in the Xaml code as seen above. These properties are not available for Floaters.

In addition to the VerticalAnchor we also have the HorizontalAnchor to position the Figure appropriately. The other interesting prooperty is CanDelayPlacement which can delay the position of the Figure. This scenario occurs when the image doesnt fit in correctly in the the column and has to move over to the next column/page. In the normal scenario, we would have a gaping hole in the layout. However, if we use the placement property the empty space gets filled in and the layout looks a lot better.

That describes the Figure short and sweet :).