WPF basics: Basic Concepts and functions

Source: Internet
Author: User

Basic concepts and functions

WPF is a unified Display System for windows. It is designed specifically for. net, including a display engine and a group of managed classes. The above explanations of the concept of WPF are obviously simple and abstract, but readers can first learn more from the following three aspects:

(1) WPF provides a unified description and Operation Method for user interfaces, 2D/3D images, documents, and media. The DirectX 9/10-based WPF not only brings unprecedented 3D interfaces, but also greatly improves the traditional 2D interface by using its graphic vector rendering engine, for example, Windows Vista's translucent forms all benefit from WPF.

(2) XAML is a new XML-based descriptive language created by Microsoft to build the next-generation application interface. It can be customized for all interface elements of the WPF program, in this way, a WPF-style interface is formed and a well-organized XML document is formed. With XAML, descriptive code and Program Logic code can be separated (some are similar to ASP. NET), which improves development efficiency and facilitates team development.

(3) WPF has many advantages. For example, unified models are widely used to support integration of multiple media types, rich custom functions, simple deployment methods, revolutionary Declarative Programming modes, and hardware acceleration.

WPF supports many functions, including:
Basic User Interface: This is the most basic and important function of WPF. Using the Panel and controls provided by WPF, you can achieve the basic layout and presentation of applications.
Document: WPF applications can use the fixeddocument tag of XAML to display XPS documents. You can also use the flowdocument flag to display the stream document. Streaming documents are similar to traditional screen documents, allowing users to scroll through their content. In addition, developers can set different attributes of this tag to better adapt the document to its environment. For example, a document can display a page each time, so that the reader does not have to scroll up or down the page. WPF can also automatically determine the number of columns to split the document according to the window size of the displayed document, so as to improve the readability of the document on the screen as much as possible.

Graphics: WPF also supports creating 2D and 3D vector graphics. For two-dimensional jobs, WPF provides standard abstractions, such as shapes, brushes, and drawing pens, and allows 3D graphics to define models to specify light and camera location information. Unlike earlier technologies (for example, Windows Forms relies on GDI + to draw images), WPF graphics are not partitioned by a single concept that developers must understand. On the contrary, The XAML elements used for graphics can naturally combine with other elements on the user interface. Buttons can contain graphical content, text and graphics can be combined, and other functions.

Image: using the XAML Image Tag, the WPF application can display images in different formats, including JPEG, GIF, and other formats. WPF relies on Windows imaging component (WIC) to provide a standard framework for codecs and software for displaying and storing images. In WPF, image elements can be combined with other elements to enable buttons to display images rather than simple text labels.

Media: WPF applications can use the mediaelement tag to display videos and audios in different formats, including WMV, Avi, and MPEG. Similarly, this element can be combined with other XAML elements, such as displaying videos on all sides of a 3D cube.

Animation: WPF provides built-in support for dynamic display of most user interfaces. For example, you can zoom in or out a circle and smoothly change the button size. An application can also define a synopsis containing a timeline, allowing you to adjust the sequence of animations.

Data Binding: because many WPF applications need to display data, it is helpful to provide automatic support for ing data to user interface elements. WPF can provide such data binding for information contained in objects and other sources. WPF data binding also allows you to sort and filter data before it is displayed.

3. Learning suggestions

At present, more and more friends are paying attention to and learning WPF technologies. However, for various reasons, Chinese documents are rare for domestic readers, so they have to read English documents. This is really helpless. I will provide some learning suggestions based on my own experience in learning WPF technology to help readers avoid detours.

First, beginners need to have a general understanding of WPF technology, such as understanding the relationship between WPF and. Net 3.0, the reasons for the introduction of WPF, WPF functions, system framework, and development environment. To this end, you can use search engines to find relevant content or read articles in this series.

Next, beginners will enter the learning stage of the basic content, including the steps for developing the WPF application, layout, control usage, data binding, graphics and images, and deployment. We recommend that you read msdn for more information about the content. While reading the document, you must strengthen your practice and practice with multiple codes to better understand your knowledge and lay a solid foundation.

Finally, it is recommended that you thoroughly study and study some typical WPF instances, such as the instance family show. You can find the relevant information at http://www.vertigo.com/familyshow.aspx. New York Times reader is also a famous WPF instance. For more information, see http://firstlook.nytimes.com /. By studying these typical examples, beginners will be greatly improved.

Summary
Based on the introduction in this article, I believe that the reader has learned some basic knowledge about WPF technology. In fact, WPF is not only a complex graphics engine, but more importantly, it will open a new chapter for developing Windows applications. In particular, the use of tags to build an interface and the use of code to write logic will completely break the concept of thinking that Windows developers stick to in the past. It is believed that with Microsoft's operating system, market promotion, and broad industry support, WPF will surely have a broad prospect.

In subsequent articles, readers will gradually gain an in-depth understanding of WPF technology, such as the WPF system architecture, class hierarchy, and development environment.

 

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.