[WPF Series] Basic Learning (a) what is WPF?

Source: Internet
Author: User

Introduction

Before learning, we should first understand the background of the birth of WPF and the problems or novelty it can solve.

Introduction to WPF

The full name of WPF is Windowspresentationfoundation, one of the three core development libraries of Microsoft's newly released Vista operating system, which is primarily responsible for graphical display, so called presentation (rendering).

Microsoft unveiled a project codenamed Avalon as early as the 2003 Los Angeles PDC, which they see as the next-generation user interface technology and are unanimously endorsed by developers and users alike. On the 2005 PDC, Microsoft showed a more complete version of Avalon than in 2003, and gave it an official new name: Windowspresentationfoundation (WPF), now

As a new graphics engine, WPF is based on DirectX and of course adds a lot of new functionality. Its 2D and 3D engines are powerful to look at Vista after the Windows interface is clear, coupled with its support for Aero graphics engine, even more so you just to magic. I use here is window7, the effect compared to WINDOW8 and the forthcoming release of Window10 still have a gap. The following 3D effect in this Window7 should be known to everyone (Window+tab).

So, what is WPF and why is it so important?

First, it clearly and effectively separates the user interface from the program implementation. It allows designers of the user interface to design visualizations and developers who write internal core code to work in parallel. This is very important:

    • The appearance markup language and background code are separated, reducing development and maintenance costs
    • Separating the two, software development companies can enable designers to focus on making the design work better, while allowing developers to support them. It also improves
    • It is better to support the internationalization of application software. Different independent interfaces can use different localization schemes, while the internal code is generic.

WPF uses an XML-based language to define the user interface to do the work described above. This language is called XAML (extensible Application Markup Language). , XML Application Markup Language second, WPF uses a vector-based rather than raster-based drawing engine, which is quite different from the earlier Windows drawing engine. The raster drawing engine paints the surface by drawing pixel points on the screen. Pixels are just dots, so if the screen resolution (DPI, dots per inch) increases, it will become worse. With the high DPI resolution now on the screen, fonts must use hundreds of DPI to achieve a certain level of browsing. Microsoft Word, for example, the default English font number 12th Timesnewroman, in the current ordinary resolution of the effect can be but to the ultra-high-resolution display on the effect is not. Managing these raster-based image points consumes a lot of processing power and is wasteful. Instead of pixels, a vector-based approach is used to draw fonts and other linetypes in an extensible coordinate system so that they can be independent of the DPI. Think of the gap between Windowsmetafile (WMF) and bitmap files (BMP) you'll see. At the same time, vector graphs make some transformations such as 3D, rotation and animation more convenient and easy to operate. Refer to the WPF Introduction page from MSDN.

Because of the separation of Xmal and background code, it also brings new design patterns to the WPF foreground presentation.

WPF applications commonly used in presentation layer design mode MVVM

Common to the presentation layer design pattern:

MVVM Pattern Relationships

Based on the structure of WPF foreground XAML and behind-the-scenes code, MVVM is the best design pattern respected by WPF applications, and now there are a number of MVVM schema frameworks:

Microsofts MVVM Toolkit Now no longer updated, interested can see the source

MVVM Foundation

Not updated now
MVVM was originally implemented

MVVM Light Toolkit

Look at the name to know is the lightweight MVVM framework, now there are many applications in the mobile client
Https://github.com/Caliburn-Micro
https://caliburn.codeplex.com/
The framework is large, but now there is a lite version, and the main lite version

Patterns & Practices:prism

Microsoft's Open source code, continuously updated,
The main thrust of Microsoft, of course, is natural advantage.

As to how these frameworks should be chosen, follow-up in-depth research. At present, because the author chooses only Prism to develop, the other frames follow slowly contact.

WPF Technology Outlook

With the window System update, I believe that everyone saw the Microsoft's connected dream is a step-by-step implementation, Microsoft released Windows 10 system using cross-platform design, and WPF in the new version of the system is more and more, so at present, WPF development prospects are quite optimistic. While it seems that Microsoft's WPF update is not doing much, it is said to be developing the next generation of WPF.

Summarize

This article simply introduces the next birth history, and then introduces WPF's novelty markup and code-behind (presentation and code separation), which leads to the unique MVVM presentation mode of WPF. Finally, some basic or common MVVM open source frameworks are briefly listed.

In the next article we will formally begin to learn about WPF.

Reference documents

What-is-wpf

Comparison of Architecture Presentation Patterns MVP (SC), MVP (PV), PM,MVVM and MVC MVC,MVP and mvvm:a Comparison of Archite Ctural Patterns Understanding MVC, MVP and MVVM Design Patterns is WPF Dead? –no!

[WPF Series] Basic Learning (a) what is WPF?

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.