Windows Presentation Foundation (WPF) Introduction

Source: Internet
Author: User

 

Windows Presentation Foundation: a unified approach for different user interfaces

User interfaces are an important part of almost all applications. Now, users have higher and higher requirements on these interfaces. Of course, we still need the traditional menu-driven GUI. However, many applications also need to be able to play videos, run animations, use 2D or 3D graphics, and call different documents. The above functions must be available to access applications through installed desktop clients or Web browsers.

These user interface functions on Windows have been provided in different ways. For example, developers can use.. NET Framework to create a Windows GUI, use HTML, Java applets or JavaScript code to create a Web browser interface, or use software such as Windows Media Player and Adobe Flash Player to play videos, the document format is defined by Microsoft Word, Adobe PDF, or other software.Obviously, developers are facing a huge challenge: how to use different technologies to create consistent user interfaces for different clients. This is quite difficult.

Windows Presentation Foundation (WPF), initially codenamed "aveon ",It is designed to solve this problem. WPF provides a consistent technical basis for all these user interfaces, greatly simplifying the work of developers. WPF uses a more modern method that supports video, animation, 2D or 3D graphics, and various types of documents, allowing users to process information in a new way. In addition,WPF also provides a general foundation for desktop clients and browser clients, greatly simplifying application development.

Let's startThe interface in Figure 4 (including images, on-site images, 3D views, and so on) is used as an example to describe some functions of WPF. In the past, developers needed to understand various technologies before they could work. Now, with this more consistent method, developers can easily create user interfaces in similar examples.

Figure 4

Another problem that has long plagued User Interface developers is,Different roles are required to create an efficient interface. Software developers need to write the corresponding interface logic, but they are not the best candidates for defining the interface perception.Generally, designers and experts in the human-computer interaction field are more suitable for this job. However, in the context of previous technologies (such as Windows Forms), these problems are entirely determined by developers. There is no effective collaboration between developers and designers.WPF solves this problem with the help of Extensible Application Markup Language (XAML. XAML is an XML-based language that allows you to specify the user interface in declarative mode-rather than code. In this way, the development tool can easily generate and use interface specifications based on the visual display created by the designer. In fact, Expression Interactive Designer, a new Microsoft product, is designed for this purpose. Use this tool (other provided by a third party ),Designers can create an interface appearance and then generate the xaml definition of the interface they created. After importing these definitions to Visual Studio, developers can start to build the logic required by the interface..

After a developer creates an installed WPF application that runs on Windows, all the functions provided by WPF can be used. However,To create a client program running inside a Web browser, the developer should create a XAML browser application, which is usually called XBAP.Similar to the basic principle of the installed WPF application, XBAP allows you to display the same style as the user interface in a downloadable browser application. The two applications can use the same code, which means that developers no longer need different technical sets for desktop and browser clients. In particular, running the XBAP downloaded from the Internet in the Security Sandbox will restrict the functions of the application according to the current situation of such rich Internet applications. However, a large subset of user interface functions provided by the installed WPF application can also be used for XBAP.

Both the WPF installation application and XBAP can utilize modern graphics support from WPF, including hardware acceleration, vector graphics, and more. By providing more powerful graphic support functions, WPF makes a series of data visualization options possible,However, it is impossible to achieve this by using Windows Forms or other early technologies. WPF also provides the basis for XML Paper Specification (XPS) to define standard formats for viewing, distributing, and printing fixed-Format documents.

User InterfaceIs a complex and important part of modern applications. Using WPF and. NET Framework 3.0, a complete and consistent solution is provided to cope with user interface problems. The goal is to enable relevant personnel (including developers and designers) who build user interfaces to work more effectively.

Source: guoguo: Windows Presentation Foundation (WPF) Introduction

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.