Professional Documents
Culture Documents
Visual Studio 2008: Windows Presentation Foundation
Visual Studio 2008: Windows Presentation Foundation
Windows® Presentation
Foundation
Module 7: Managing Documents
• Creating and Viewing Flow Documents
• Packaging Documents
• Printing Documents
Lesson: Creating and Viewing Flow Documents
• What Are Flow Documents?
• Flow-Related Controls
• Customizing Text
Flow documents:
• Are a XAML construct for holding large blocks of textual data
• Provide an optimized viewing and reading experience
• Dynamically adjust and reflow content
• Provide additional viewing features
Searching
Navigation
Zooming
Defining a Flow Document
• Define a FlowDocument element
<FlowDocument>
<Paragraph>
This is a paragraph.
</Paragraph>
<Paragraph>
<Italic>This</Italic> is <Bold>another</Bold>
paragraph. This paragraph has more formatting
<Span FontFamily="Lucida Handwriting">
than the first</Span>.
</Paragraph>
</FlowDocument>
Types of Flow Document Containers
Host the <FlowDocument> in a viewer control
• FlowDocumentReader
• FlowDocumentPageViewer and FlowDocumentScrollViewer
• RichTextBox
<FlowDocumentReader>
<FlowDocument> Zoom
...
</FlowDocument>
</FlowDocumentReader>
Search
Navigation Viewing Mode
Demonstration: Defining FlowDocument Containers
In this demonstration, you will see how to:
• Define a FlowDocumentReader
Block-derived classes:
• Paragraph
• Section
• BlockUIContainer
• List
• Table
Inline-derived classes:
• Run
• Span
• Hyperlink
• Bold
• Italic
• LineBreak
Customizing Text
Text is the primary type of content in a flow document
• To decorate text, set the TextDecorations property
• To set typographical values, set the Typography property
...
<Run Typography.NumeralStyle="Normal">1234567890</Run>
<Run Typography.NumeralStyle="OldStyle">1234567890</Run>
...
<Paragraph TextDecorations="Strikethrough">
Example with StrikeThrough TextDecoration
</Paragraph>
...
Demonstration: Customizing Text in a FlowDocument
In this demonstration, you will see how to:
• Change the TextDecorations property of a Paragraph
element
• Change the Typography settings of a Paragraph element
Lesson: Creating and Viewing Fixed Documents
• What Are Fixed Documents?
<FixedDocument>
<PageContent>
<FixedPage>
<TextBlock Text="This is a fixed document." />
...
Defining a Fixed Document Viewer
Host the fixed document in a viewer control
<DocumentViewer>
<DocumentViewer.Document>
<FixedDocument ...>
...
Search
Demonstration: Creating a FixedDocument in XAML
In this demonstration, you will see how to:
• Create a new PageContent element
• Create a PackageRelationship
• Define dependency relationships
• Define informational relationships
...
package.CreateRelationship
(imagePartUri, TargetMode.Internal,
"http://packages/2008/resource");
...
Demonstration: Creating a Digitally Signed
ZipPackage
In this demonstration, you will see how to:
• Create a ZipPackage
• Sign a PackagePart
• Load a ZipPackage
• Create an XpsDocumentWriter
Logon information
Virtual machine 6460-LON-DEV-07
Password Pa$$w0rd
• Best Practices
• Tools