Got Floaters?
An interesting feature to display content is the use of Floaters and Figures. Today, I'll be discussing about floaters. So the first question that comes to mind if you are not very familiar with Office terminology is - What is it? - Floaters display information in a flow parrallel to the main content. Floaters are allowed only within a FlowDocument or a TextFlow tree. So it can have the same cotent that a RichTextBox has.
A common scenario for using floaters would be to have an image displayed next to some text. This would be something like a news page that we see online.
As seen above, this looks pretty kewl... So whats the syntax for the Floater. A simple way to play around with Floaters to use XamlPad. This small app comes along with the SDK.
The above was got from the following code:
<FlowDocument xmlns="https://schemas.microsoft.com/winfx/avalon/2005"
xmlns:x="https://schemas.microsoft.com/winfx/xaml/2005" TextAlignment="Left">
<Paragraph>
To celebrate the release of Xbox 360 and usher in the next generation of gaming, ...
<Floater BorderBrush="black" BorderThickness="2" >
<Paragraph>
<Image Source="e:\xbox.bmp" Height="100"/>
</Paragraph>
</Floater>
From sundown Nov. 20 through 12:01 a.m. Nov. 22 – ... </Paragraph> </FlowDocument>
You could also have a structure such as :
<Paragraph> ... most members live in the caves of unimaginable awesomeness <Floater Width="300"> <Paragraph>Main Point: Tha cave people.....</Paragraph> </Floater></Paragraph>
This would insert text in a Floater. The Floater construct also has alignment properties, so we could align it on the left, right or center using the HorizontalAlignment property.
Thats a brief introduction to Floaters. Have fun coding.