SIGN UP MEMBER LOGIN:    
ARTICLE

How to create FlowDocuments in Expression Blend

Posted by Manoj Singh Panwar Articles | Expression Studio October 20, 2011
In this article you will know What FlowDocuments are and how to add FlowDocuments in Expression Blend.
Reader Level:

Providing readability of text to a greater extent across all window sizes and monitor resolutions is the characteristic of Windows Presentation Foundation Flow Documents. In simple terms, A Flow Document is nothing but simple combination of text, audio, video, images ext. in such a way that the user can watch these documents at every resizable extent irrespective of the resolution of the monitor or sizes of the windows, otherwise the documents would have grown fuzzy and blurred and pixilated at higher resolutions but WPF Flow Documents  gives the opportunity to read these documents at all resolutions.

A few terms that we will come across while dealing with Texts in WPF.

FlowDocuments : These are useful tools of WPF which change itself automatically according to the resolution or window sizes. This is the salient feature that makes it a unique one.

FlowDocumentReader : It is a very sophisticated tool for viewing the flow documents. There are three modes of viewing documents - Page mode, Two Page mode and Scroll mode. It also provides the feature of searching within the document. It also has resizing tools to view texts at different resolutions.

FlowDocumentPageViewer : This can be assumed as viewing the page of FlowDocumentReader without search feature and without options for modes.

FlowDocumentScrollViewer : This feature allows the viewer to view long texts using scroll bar.

RichTextBox : This feature of flow document allows user to add, edit and view texts but there is no option for resizing, searching, and adding texts into columns automatically.

Now lets start Creating FlowDocument

Step 1 : Since we are going to create FlowDocumentScrollViewer in Blend so Launch Expression Blend and select WPF --> WPF application.

launch-blend.gif


select-wpf.gif

Step 2 : Now you have the artboard in front of you, all you need to do is go to assets and search for FlowDocumentScrollViewer. After this the control appears in the panel, select this control and drag it on the artboard.

flow.gif

Step 3 : Select the FlowDocumentScrollViewer control on the artboard and resize it. For resizing either resize through the selection tool by extending the boundaries of the control or goto the menu bar Object-->Auto size--> fill. This fills the control on the artboard completely.

object-fill.gif

Step 4 : Now rename the text in the flowdocument and its respective XAML coding appears like this:

Rename.gif

Step 5: Select the document and Right click on it --> Group into --> Grid.  This is done to allow images,videos etc to get easitly added to the Document

Step 6: Now Adding a Toolbar (by which user can resize the text) to the FlowDocumentScrollViewer. By default this property is disabled, to enable this property select the control and goto--> property --> miscellaneous -->mark Check box IsToolbarVisible.

toolbar.gif

Creating a FlowDocumentReader and FlowDocumentPageViewer in Blend

This is another good feature that we can create other FlowDocuments from the existing FlowDocument, the only thing need to do is make small changes in the tags in XAML. For example to change FlowDocumentScrollviewer to FlowDocumentReader we just need to modify the starting tags as shown in the fig. Similarly we can change it to FlowDocumentPageViewer also.

change1.gif

Now FlowDocumentScrollViewer in above image is change to FlowDocumentReader in image below:

Chang2.gif

Now Adding Text to the Document : There are two ways to Enter the text into the document either by selecting the FlowDocument from the artboard and Right click--> Edit text or through XAML coding, in this tags are used to enter the text in the FlowDocument as shown in the fig below.

texting.gif

Now adding image to the FlowDocument : For adding image Double click the FlowDocument to make it active the select the image and drag it into the FlowDocument. This image can be resized and adjusted according to the need.

tools.gif

Output : Finally On pressing F5 the following output is generated which shows a FlowDocument enriched with Text as well as image. Apart from this the FlowDocument also has resizing tools at the bottom to view the document at any resolution.

output.gif

Hope this article provides you sufficient help to get acclimatized with Expression Blend.

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor