Skip Navigation Links

 CodeMatrixThe ultimate site for .NET programmers

Skip Navigation Links.    

Windows Presentation Foundation (WPF)

1. What is WPF?
WPF enables software developers and graphic designers to create modern user experiences without having to master several difficult technologies. The following are the advantages of WPF.

Broad integration: Prior to WPF, a windows developer who wanted to use 3D, video, speech, and rich document viewing in addition to normal 2D graphics and controls would have to learn several independent technologies with a number of inconsistencies and attempt to blend them together without much built-in support. But WPF covers all these with a consistent programming model as well as tight integration when each type of media gets composited and rendered.

Resolution independence: WPF gives the power to shrink or enlarge elements on the screen independently from the screen’s resolution. This is possible because of vector graphics.

Hardware acceleration: Although WPF is a new technology; it is built on top of Direct3D. Specifically, content in a WPF application- whether 2D or 3D, graphics, or text- is converted to 3D triangles, textures and other Direct3D objects and rendered by hardware.

Declarative programming: .NET programs often leverage declarative custom attributes plus configuration and resource files based on Extensible Markup Language (XML). But WPF takes declarative programming to the next level with the introduction of Extensible Application Markup Language (XML).

Rich composition and customization: WPF controls are extremely composable in ways never before seen. You can create a Combo Box filled with animated Buttons, or a Menu filled with a video clips.

Easy deployment: WPF provides options for deploying traditional windows applications or hosting applications in a web browser.

2. What is XAML?
XAML is a relatively simple and general-purpose declarative programming language suitable for constructing and initializing .NET objects. The .NET framework 3.0 includes a compiler and runtime parser for XAML. The use of XAML encourages a separation of front-end appearance and back-end logic, which is helpful for maintenance.

3. What are dependency properties?
WPF introduces a new type of property called a dependency property, used throughout the platform to enable styling, automatic data binding, animation, and more. A dependency property depends on multiple providers for determining its value at any point of time.

4. Is XAML file compiled or built on runtime?
Most WPF projects will leverage the XAML compilation supported by MSBuild and Visual Studio. XAML compilation involves three things: converting a XAML file into a special binary format, embedding the converted content as a binary resource in the assembly being build, and performing the plumbing that connects XAML with procedural code automatically. Both C# and Visual Basic has the support for XAML compilation.
5. What are the kind of documents are supported in WPF?
WPF divides documents into two broad categories based on their intended use; these document categories are termed "fixed documents" and "flow documents." Fixed documents are intended for applications that require a precise "what you see is what you get" (WYSIWYG) presentation, independent of the display or printer hardware used. Typical uses for fixed documents include desktop publishing, word processing, and form layout, where adherence to the original page design is critical. For example, a fixed document page viewed on 96 dpi display will appear exactly the same when it is output to a 600 dpi laser printer as when it is output to a 4800 dpi phototypesetter. The page layout remains the same in all cases, while the document quality maximizes to the capabilities of each device.
By comparison, flow documents are designed to optimize viewing and readability and are best utilized when ease of reading is the primary document consumption scenario. Rather than being set to one predefined layout, flow documents dynamically adjust and reflow their content based on run-time variables such as window size, device resolution, and optional user preferences. A Web page is a simple example of a flow document where the page content is dynamically formatted to fit the current window. Flow documents optimize the viewing and reading experience for the user, based on the runtime environment. For example, the same flow document will dynamically reformat for optimal readability on either high-resolution 19-inch display or a small 2x3-inch PDA screen.


Copyright © 2008 www.codematrix.net, All Rights Reserved. Disclaimer