03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

WPF Printing ❘ 797<br />

<br />

Nullam dapibus dapibus ...<br />

<br />

<br />

Etiam lacus eros ...<br />

<br />

<br />

<br />

<br />

<br />

See the WPF documentation for information about the classes that you can use to produce output.<br />

FixedDocuments<br />

Like a FlowDocument, a FixedDocument holds graphical objects. Instead of rearranging its objects<br />

as space permits, a FixedDocument always places its objects in the same positions. This is similar to<br />

the way a PostScript document displays items at fixed positions.<br />

The following code shows XAML that defines a FixedDocument inside a DocumentViewer.<br />

<br />

<br />

<br />

<br />

... Page 1 content elements ...<br />

<br />

<br />

<br />

<br />

... Page 1 content elements ...<br />

<br />

<br />

<br />

<br />

FixedDocuments Need Fixing<br />

There is a well-known bug in Visual Studio’s XAML designer that prevents it<br />

from correctly displaying XAML code that contains a FixedDocument. If you load<br />

XAML code into the designer, Visual Studio reports errors such as the following:<br />

Property ‘Pages’ does not support values of type ‘PageContent’.<br />

The property ‘Pages’ is set more than once.<br />

The specified value cannot be assigned. The following type was expected:<br />

“PageContentCollection”.<br />

If the XAML code is properly formed, however, the program will compile and run<br />

without problems.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!