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 the , advanced Typography , Vector Graphics , Raster Graphics , Animation , data binding, Audio and Video .

Microsoft Silverlight is a web-based subset of WPF. During development it was named WPF/E, which stood for "Windows Presentation Foundation Everywhere". Silverlight is based on XAML and JScript . The Silverlight subset enables Flash -like web and mobile applications with the exact same code as Windows .NET applications. 3D features are not supported, but XPS , vector-based drawing and hardware acceleration are included.


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 .

  • --- Supports vector-based graphics, which allow infinite lossless scaling.

  • --- Supports 3D model rendering and interaction in 2D applications.



Deployment

  • WPF isn't just for building traditional standalone applications. Its deployment model offers both standalone and '''XAML Browser Applications''' ( XBAP ) flavors. The programming model for building either flavor of application is similar.

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

  • --- XAML Browser Applications ( XBAP s) are programs that are hosted inside a Web Browser such as Firefox , Internet Explorer , Mozilla , Opera or Safari . Hosted applications run in a ''partial trust'' Sandbox environment, and are not given full access to the computer's resources and not all WPF functionality is available. The hosted environment is intended to protect the computer from malicious applications. Starting an XBAP (pronounced "ex-bap") 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 executable different from the browser.



Interoperability

  • WPF provides interoperability with Win32 : Via hosting, one can use Windows Presentation Foundation inside existing Win32 code, or one can use existing Win32 code inside Windows Presentation Foundation. WPF and Win32 Interoperation Overview

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



Media Services

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

  • The 3D capabilities in WPF are a subset of the full featureset provided by 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 some AVI files.

  • 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. Lacks a DataGrid control but 3rd-party vendors are already offering some.

  • A powerful concept in the WPF is the logical separation of a control from its appearance.

  • --- A control's template can be overridden to completely change its visual appearance.

  • --- A control can contain any other control or layout, allowing for unprecedented control over composition.

  • Features retained mode graphics, so that applications do not have to be bothered with repainting the display.



Annotations



Imaging



Effects

  • WPF provides for bitmap effects, however, they are rendered in software. GPU features like Pixel Shader s are not used for bitmap effects.

  • Special effects such as dropshadows and blurring are built in.

  • Other effects such as reflections can be easily implemented.



Text

WPF includes a number of extremely rich typographic and 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 (Compact Font Format) fonts.

Support for OpenType typographic features includes:

The WPF text engine also supports built-in Spell Checking . It also supports such features as automatic line spacing, enhanced international text, language-guided line breaking, Hyphenation , and justification, bitmap effects, transforms, and text effects such as shadows, blur, glow, rotation etc. 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.

WPF text rendering takes advantage of advances in architecture of WPF, ClearType cannot be turned off in WPF applications. WPF ClearType anti-aliasing cannot be turned off

The extent to which glyphs are cached is dependent 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 2 MB of video memory per font), 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. Caching these partially-rendered glyphs requires significantly more memory (Microsoft estimates 5 MB per process). Cards that don't support DirectX 9 have no hardware-accelerated text rendering capabilities.


Alternative input

WPF supports Digital Ink -related functionality.


Accessibility

WPF supports Microsoft UI Automation to allow developers to create accessible interfaces.


XAML

See Also: Extensible Application Markup Language



Following the success of Markup Language s for web development, WPF introduces a new language known as eXtensible Application Markup Language ( XAML ) (pronounced "Zammel"), which is based on XML . XAML is designed as a more efficient method of developing application user interfaces.

The specific advantage that XAML brings to WPF is that XAML is a completely declarative language. In a Declarative Programming Language , the developer (or designer) describes the behavior and integration of components without the use of Procedural Programming . This allows someone with little or no traditional programming experience to create an entire working application with no programming. Although it is rare that an entire application will be built completely in XAML, the introduction of XAML allows application designers to more effectively contribute to the application development cycle. Using XAML to develop user interfaces also allows for separation of model and view; which is considered a good architectural principle. In XAML , elements and attributes map to classes and properties in the underlying API's.

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 ( C# , VB.net ). The XAML code can ultimately be 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. XAML can also be compiled and run "on demand" similar to an html web-page.

Although XAML has been introduced as an integral part of WPF, the XAML standard itself is not specific to WPF (or even .NET). XAML can also be used to develop applications using any programming API and is in itself language independant. Nevertheless, special care has been taken in developing the WPF APIs to maximize interoperability with the declarative model that XAML introduces.

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

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, most currently of beta quality, some commercially released.
  • Microsoft Cider is an add-in for the Visual Studio 2005 designer for building Windows Presentation Foundation

  • Visual Studio 2008 Beta 2 for building Windows Presentation Foundation applications.

  • Microsoft Expression Blend 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 Design is a bitmap and 2D-vector graphics tool that allows export to XAML .

  • 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.

  • Xceed DataGrid for WPF free full-featured DataGrid control for WPF.

  • Blendables Tools and components for designers and developers from IdentityMine, Inc.



MICROSOFT SILVERLIGHT

See Also: Microsoft Silverlight


Silverlight is a cross-platform, cross-browser XAML-based WPF technology ASP.NET : WPF/E - December 2006 Community Technology Preview that provides features such as video, vector graphics, and animations to multiple operating systems including Windows Vista , Windows XP , and Mac OS X . Specifically, it is currently provided as an add-on for Mozilla Firefox , Internet Explorer 6 and above, and Apple Safari . Silverlight and WPF only share the XAML presentation layer.

These extensions will allow browsers to use Silverlight's graphics capabilities. The browser extensions will be similar to Adobe Flash , a highly popular graphic plug-in available for most browsers. Internet Explorer has additional native support for WPF through the use of XBAP, available in Windows Vista and Windows XP with the .NET Framework version 3.0 installed. Silverlight will be supported in older versions of the browser.

Silverlight will work in concert with XAML and will be scriptable with JScript . Version 1.1 will also contain a version of the Common Language Runtime so it can execute VB.Net and C# code in a sandbox with limited local file access.

Silverlight is seen as a direct competitor of Adobe Flash Player , created by Macromedia which is now a part of Adobe Systems .

The first CTP of Silverlight, then named by its development code-name of WPF/E, was released in December 2006. Additional CTPs have been released in January and February. SilverLight version 1.0 was released on September 05, 2007.


WPF APPLICATIONS

WPF is intended to be the next-generation graphics API for Windows applications on the desktop. Applications written in WPF are visually of a higher quality. The following are some of Microsoft's own product or other third-party mainstream applications written in WPF:

See Also: List of WPF applications





.NET MICRO FRAMEWORK

The .NET Micro Framework includes a GUI object model loosely based on WPF, although without support for XAML.


REFERENCES



SEE ALSO



EXTERNAL LINKS