Windows Presentation Foundation

Source: Internet
Author: User
Over the past decade, we have seen that the application development model has formed two branches-the traditional "Smart Client" to install applications and web-based applications, both of them compete for dominance in the development community. Both models require developers to sacrifice functions that are taken for granted in another model. Web applications provide a greater scope of application, simpler deployment, and simplicity, to compensate for the loss of status, more complex development models, and low-integration platform experience (despite the recent re-discovery of technologies such as Ajax. On the other hand, applications developed in the Windows Field are expected to work offline and make full use of client hardware, but the simplicity of deployment and support for countless marking tools that can be used for web applications are lost. It can provide independent, browser-based applications, simple deployment, excellent tool support, and client application model integrated with the in-depth platform.

Since its first appearance in the first version of Windows, the graphics subsystem (USER32 and GDI Library) that forms the core of Windows user experience has actually been born for nearly two decades. Of course, over time, USER32 and GDI have undergone significant evolution and development, and many new services and functions have been introduced in all fields. At the same time, new rendering technologies such as direct3d have emerged, which can take full advantage of the graphic functions published in the latest video card. However, most mainstream applications currently do not provide the experience of these graphics cards.

  Windows Presentation Foundation

Windows Presentation Foundation (formerly known as "aveon") is a new key graphics subsystem in windows. It provides a unified approach for user interfaces, 2D and 3D graphics, documents, and media. It is generated based on the. NET Framework and uses direct3d for vector-based presentation, providing a powerful solution for generating all kinds of immersion applications. In addition, the Windows Presentation Foundation provides Declarative Programming models to achieve "instruments" and flexibility, making designers an integral part of the development process.

Table 1. Windows Presentation Foundation services
Basic services XAML, property system, input & eventing, accessibility
Media Service 2d, 3D, audio, video, text, imaging, animation, effects, composition engine
Document Service XPS documents, open packaging conventions
User Interface Service Application Services, deployment, controls, layout, Data Binding

  
The design principles behind Windows Presentation Foundation can be classified as follows:

· Inheritance: The Windows Presentation Foundation provides a unified API that spans the services identified in table 1. Today's developers are faced with countless different technical and API options, depending on whether they are for 2D graphics (GDI or GDI +), user interfaces (USER32 or Windows Forms) media (DirectShow) or 3D (direct3d or OpenGL ). The Windows Presentation Foundation provides a single model orthogonal to all of the preceding services and allows seamless integration of content into a single application. You can use the same structure to implement animation, data binding, and style settings, regardless of whether it is for 2D, 3D, or text content.

· Vector graphics. As described in the introduction, the Windows Presentation Foundation makes full use of powerful graphics processing units that are part of modern PC systems. Essentially, the composite engine, based on vectors, allows scaling of all outputs to match the resolution of a particular computer. Rendering architecture uses direct3d to complete all output: on a video card that uses hardware for DirectX 7 or later, Windows Presentation Foundation uses GPU to present output as much as possible. If you cannot use hardware rendering, you can use software rendering instead. Finally, the floating-point logical pixel system and 32-bit argb Color support provide a rich and predictable High Fidelity experience for future technical needs (such as high DPI display.

· Declarative Programming. Windows Presentation Foundation introduces XAML (eXtensible Application Markup Language), an XML-based language for instantiating and filling nested object hierarchies. Although XAML is not limited to Windows Presentation Foundation, it is essentially applicable to tasks such as UI definition and build. The XAML design allows an application to analyze and manipulate the UI logic of a dynamic workflow scheme at runtime. What's important is that, the XAML/code hiding model embodied in the Windows Presentation Foundation allows designers and developers to use tools such as expression "Sparkle" and third-party expert tools (including Zam 3D and mobiform Aurora ), collaborate to design and develop client applications.

· Easy deployment. With support for stand-alone applications and Web browser applications, Windows Presentation Foundation provides the best models in both deployment models. Web browser applications run from inside Internet Explorer-occupying the entire window or in an embedded framework. They provide the easy-to-deploy features well known for web applications and operate in a trusted sandbox (sandbox can prevent client computers from being compromised by malicious applications ). However, they can still use the local client hardware and use 3D and media services to get the most abundant web experience available. On the other hand, independent applications are installed locally using clickonce or MSI technology and provide full access to the basic platform.

· Document lifecycle. Windows Presentation Foundation introduces a new set of documents and printing technologies. Applications that need to permanently store data in the local storage area can use open packaging conventions (Open packaging conventions)-this is a zip-based packaging convention shared with office 12, it supports core attributes and custom metadata, digital signatures, and permission management functions. XML paper specification (XML File Specification) visual effects can be established in printable and portable formats.

Figure 1 shows the architecture diagram that identifies the main components of the Windows Presentation Foundation. (Note that the size of the box does not represent the relative size or importance of each component .)

Figure1. Windows Presentation FoundationArchitecture

At the top layer, the presentation framework provides a managed API that provides full access to basic functions. Most Windows Presentation Foundation developers will use this layer. The framework contains a large number of standard controls (such as buttons, labels, and menus), layout panels, 2D and 3D graphics and text elements, and support for image processing effects, media, animation, and document services; it also supports interoperability with GDI, DirectX, and Windows Forms/GDI +.

The main force of Windows Presentation Foundation is the visual system. Most elements in Windows Presentation Foundation are derived from a visual base class. The visual system combines all the data and generates screen output. Here we integrate video and audio, 2d, 3D, and animation, and provide some text layout services. A combined engine located at a lower level of the architecture model presents a visual tree on the screen and considers all aspects from the transparent layer to the window area being ineffective.

All rendering operations in Windows Presentation Foundation are completed through direct3d (in fact, Windows Vista hardware Logo Program requires DirectX 9 GPU ). By moving more graphic processing operations to the GPU, we can enable the CPU to do other work, improving performance and improving the quality of graphics. However, these advantages are not limited to the 3D domain-2D graphics also use the same service; Windows Presentation Foundation does not use GDI internally (unless integrated with legacy elements ). For computers installed with Windows Vista, the new display driver model provides high-quality output, enabling media-intensive applications to achieve high performance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.