Windows Presentation Foundation Article Index for
Windows
Website Links For
Windows
 

Information About

Windows Presentation Foundation




The Windows Presentation Foundation (or '''WPF'''), formerly code named '''Avalon''', is the graphical subsystem feature of , Vector Graphics , Raster Graphics , animation, data binding, audio and video.

WPF/E is a subset of WPF, and stands for "Windows Presentation Foundation Everywhere". It is basically a mobile version of WPF, based on XAML and Javascript. 3D features are not included, but XPS , vector-based drawing, and hardware acceleration, are.


FEATURES

The following is a partial list of WPF features.


Graphical Services

  • All graphics (including desktop items like windows) will be routed through Direct3D .

  • --- This aims to provide a unified avenue for displaying graphics, as well as more advanced graphical features.

  • --- Routing the graphics through Direct3D will allow Windows to offload graphics tasks to the Graphics Processing Unit found on the computer's Graphics Card . This will reduce the workload on the computer's Central Processing Unit .

  • --- The graphical subsystem will be vector-based.

  • --- Vector-based graphics allow graphics like icons and buttons to look better when scaled to different sizes.

  • --- Because of better scaling, Windows Vista will work well with high resolution monitors. WPF ensures that as the pixels per inch (PPI) on monitors increase, displays will look better rather than smaller.

  • --- The vector-based graphics will also allow documents to scale more faithfully, improving printer fidelity in Windows Vista (see XML Paper Specification ).

  • --- Avalon allows for 3D models to be used seamlessly in 2D environments. 3D models are vector based.



Deployment

  • WPF isn't just for building traditional standalone applications. Its deployment model offers both standalone and '''Web Browser application''' flavors. The programming model for building either flavor of application is the same.

  • --- Standalone applications are those that have been locally installed on the computer using software such as ClickOnce or Microsoft Installer (MSI). Standalone applications are considered ''full trust'' and have full access to a computer's resources.

  • --- Web Browser applications are programs that run inside Internet Explorer . Programs written in this way run in a ''partial trust'' Sandbox , and are not given full access to the computer's resources. This sandbox is intended to protect the computer from malicious applications. Starting a Web Browser application from an HTML page or vice versa is seamless (there is no security or installation prompt). Although one gets the perception of the application running in the browser it actually runs in an out of process exe different from the browser.



Interoperability

  • WPF provides interoperability with Win32 : one can use Windows Presentation Foundation inside existing Win32 code, or one can use existing Win32 code inside Windows Presentation Foundation.

  • Interoperability with Windows Forms is also possible through the use of the ElementHost and WindowsFormsHost classes.



Media Services

  • Windows Presentation Foundation provides shape primitives for 2D graphics along with a built-in set of brushes, pens, geometries, and transforms.

  • The 3D capabilities in WPF are limited compared to what's available in Direct3D. However, WPF provides tighter integration with other features like user interface (UI), documents, and media. This makes it possible to have 3D UI, 3D documents, and 3D media.

  • There is support for most common image formats.

  • WPF supports the video formats WMV , MPEG and AVI .

  • WPF supports time-based animations, in contrast to the frame-based approach. This delinks the speed of the animation from how the system is performing.

  • Text rendering is supported using ClearType . This provides for sub-pixel positioning, natural advance widths, and Y-direction anti-aliasing. WPF also supports OpenType font features.



Data Binding

  • WPF has a built-in set of data services to enable application developers to bind and manipulate data within applications. There exists support for three types of data binding:

  • --- one time: where the client ignores updates on the server

  • --- one way: where the client has read-only access to data

  • --- two way: where client can read from and write data to the server

  • Binding of data has no bearing on its presentation. WPF provides data templates to control presentation of data.



User Interface

  • A set of built-in controls is provided as part of WPF, containing items such as button, menu, and list box.

  • A powerful concept in WPF is the ability to perform control/content composition, where a control can contain any other control or layout.



Annotations


Imaging


Effects


Text

WPF includes a number of text rendering features that were not available in GDI . This is the first Windows programming interface to expose OpenType features to software developers, supporting both OpenType, TrueType, and OpenType CFF fonts.

Support for OpenType includes:

Other typography features provided by WPF include line-level Justification , Ruby Character s,

WPF text rendering takes advantage of advances in ClearType technology.

WPF also offers hardware-accelerated text rendering, as well as aggressive cacheing of pre-rendered text in video memory. The extent to which this is supported is dependant on the video card. DirectX 10 cards will be able to cache the font glyphs in video memory, then perform the composition (assembling of character glyphs in the correct order, with the correct spacing), alpha-blending (application of anti-aliasing), and RGB blending (ClearType's sub-pixel color calculations), entirely in hardware. This means that only the original glyphs need to be stored in video memory once per font (Microsoft estimates that this would require 2MB of video memory per card), and other operations such as the display of anti-aliased text on top of other graphics – including video – can also be done with no computation effort on the part of the CPU. DirectX 9 cards are only able to cache the alpha-blended glyphs in memory, thus requiring the CPU to handle glyph composition and alpha-blending before passing this to the video card. Cacheing these partially-rendered glyphs requires significantly more memory (Microsoft estimates 5MB per process). Cards that don't support DirectX 9 have no hardware-accelerated text rendering capabilities.

Animated text is also supported; this refers to animated glyphs, as well as real-time changes in position, size, color, and opacity of the text.


Input


Accessibility


XAML

Following the success of Markup Language s for web development, WPF introduces a new language known as eXtensible Application Markup Language ( XAML ), which is a variant of XML . It is meant to be a faster way to develop application user interfaces and a better way for designers and developers to collaborate. Using XAML to develop user interfaces also allows for separation of model and view; this is generally considered a good architectural principle. In XAML, every element maps onto a class in the underlying API, and the attributes are set as properties on the instantiated classes. As in web development, both layouts and specific themes are well suited to markup, but XAML is not required for either. Indeed, all elements of WPF may be coded in a .NET language such as C# . The XAML code is ultimately compiled into a managed assembly in the same way all .NET languages are, which means that the use of XAML for development does not incur a performance cost.

It is likely that many applications, such as Microsoft PowerPoint and Word , will support exporting their content to WPF through a XAML representation.

There are several subset (or profiles) of XAML, such as:
  • XAML Presentation (XAML-P) - incorporates all items encompassing WPF v1.0

  • XML Paper Specification (XPS) - a subset of XAML-P for representing fixed format documents and used as the spool format for the printing subsystem in Windows Vista


There are also profiles specific to Workflow Foundation, and other domain specific subsets will likely emerge in the future.


TOOLS

There are a number of development tools available for developing Windows Presentation Foundation applications, all currently of beta quality.
  • Microsoft Expression Interactive Designer is a designer-oriented tool that provides a canvas for the creation of WPF applications with 2D and 3D graphics, text and forms content. It generates XAML that may be exported into other tools.

  • Microsoft Expression Graphic Designer is a bitmap and 2D-vector graphics tool that allows export to XAML.

  • An extension is available for the developer-oriented Microsoft Visual Studio , codenamed "Cider", that provides custom projects, Intellisense and basic visual forms design for WPF developers.

  • Electric Rain ZAM 3D provides an interactive graphical design environment for constructing 3D models that can be exported into XAML.

  • Mobiform Aurora provides an alternative tool for constructing WPF user interfaces.



WPF/E

]]
Windows Presentation Foundation/Everywhere is an extention to WPF to provide a subset of WPF features, such as hardware accelerated video, vector graphics, and animations to platforms other than Windows Vista . Specifically, WPF/E will be provided as a plug-in for Windows XP , Windows 2000 , Mozilla Firefox , Apple Safari and mobile devices.

These extensions will allow the browsers and other applications to use WPF/E graphical capabilities. The browser extensions will be in the line of Macromedia Flash , a highly popular graphic plug-in available for most browsers. Internet Explorer will have native support for WPF in Windows Vista , and will support WPF/E in older versions.


SEE ALSO



EXTERNAL LINKS