MSDN TV Demo Part 1 Continued: Creating an Easy and Enjoyable Reading Experience in WPF

Hi world! I’ve grabbed hold of Chris Han’s blogging coattails and will be posting some info about our MSDN TV Demo. Specifically about the built in (free!!) flow and dynamic layout capabilities.

Hyphenation and Optimal Paragraph

Hyphenation is an age old technique to aid in evenly breaking up the content of lines.  Optimal Paragraph is a new optimization technique for the even distribution of content among lines as well as spacing between words.  Both these features work together to offer an attractive reading visual.  The following is a brief demonstration of setting these 2 properties.


<FlowDocument IsHyphenationEnabled="False"




<FlowDocument IsHyphenationEnabled="True"




<FlowDocument IsHyphenationEnabled="True"



Reflow on Zoom and Resize

The user can resize the App window however she sees fit and the content will automatically be laid out to provide the best possible reading experience.  She can also zoom in and out of the content in order for her to discover her best possible reading experience.  The slider zoom control for the FlowDocumentPageViewer provides this functionality.


Similarly holding down the Ctrl key and turning the mouse wheel will achieve the same result.  Roll up for zooming in and down for zooming out.


Setting the ColumnWidth property indicates a minimum column width that will be used when laying out the content on a large viewing area into multiple columns.  This is done to offer the best reading experience possible.  On a window resize or content zoom, the content will reflow accordingly as demonstrated below.





Content Zoom (note the change in slider position)



Window Resize


And finally when you combine these free built in features with other free rich media capabilities you can end up with something like the following.

Now the overall effect is a little diminished since you can not actually see the movie playing, the 3d animation or hear the sound. Just download the attachment and try it out.


Unfortunately the movie file is much too large to post here so I’ve removed it from the demo. I’ve simply commented out the code to make it work.


Here are some relevant articles:

FlowDocument.IsHyphenationEnabled Property:

FlowDocument.IsOptimalParagraphEnabled Property:

Flow Content Element - Reference:

Animation Overview:

3-D Graphics Overview:

Amar Atwal