代码改变世界

What is WPF for me?

2011-03-13 19:47  Aga.J  阅读(418)  评论(0编辑  收藏  举报

    You may be familiar to windows form. We use our application based on windows form every day. And have you heard “Web OS”? Yeah, it’s a good idea. But now it is not common to see Web OS in our daily life. However in the future, Web OS may replace our traditional operating system. How does WPF relate to Web OS? It’s my own opinion to link them together. Because I think the Windows Presentation Foundation(WPF) is the intermediate product for the development of Web OS. What do I mean? To understand this, we need to know what is WPF. And I will explain that.

    WPF ,which is shorted for Windows Presentation Foundation, is mainly design to be the next generation of windows user interfaces. Like traditional windows forms, it provides a user interface on the windows desktop for application. Unlike traditional windows forms, it provides better user experience. If you have installed Visual Studio 2010, you can try to create a WPF project. You can clearly see that the presentation of the windows is totally different from the old one. In WPF, you can add controls as you do in designing web site. Besides, it supports powerful media experience.

    We start WPF from it architecture.

                    

    Please focus on the highlighted ingredients, which actually form the WPF. They are: Presentation Framework , Presentation Core , and MIL Core.

    MIL Core stands for Media Integration Layer. It is an unmanaged wrapper around DirectX and allows the Common Language Runtime to interface with DirectX.

    Presentation Core contains all of the classes and interfaces that form the groundwork for WPF. It does not contain any user interface controls- it is more like the foundations that the controls are built on.

    Presentation Framework is the subsystem that contains all of the user interface components. It has a rich library of controls that can be used by WPF applications.

    The core of WPF is a resolution-independent and vector-based rendering engine that is built to take advantage of modern graphics hardware. WPF extends the core with a comprehensive set of application-development features that include Extensible Application Markup Language (XAML), controls, data binding, layout, 2-D and 3-D graphics, animation, styles, templates, documents, media, text, and typography. WPF is included in the Microsoft .NET Framework, so you can build applications that incorporate other elements of the .NET Framework class library.

    One obvious feature in WPF is that application based on WPF can be more amazing than that based on traditional windows form. Not only WPF support DirectX to create more powerful UI, but also It develop an application using both markup and code-behind, an experience that ASP.NET developers should be familiar with. You generally use Extensible Application Markup Language (XAML) markup to implement the appearance of an application while using managed programming languages (code-behind) to implement its behavior. This separation of appearance and behavior has the following benefits:

  • Development and maintenance costs are reduced because appearance-specific markup is not tightly coupled with behavior-specific code.
  • Development is more efficient because designers can implement an application's appearance simultaneously with developers who are implementing the application's behavior.
  • Multiple design tools can be used to implement and share XAML markup, to target the requirements of the application development contributors; Microsoft Expression Blend provides an experience that suits designers, while Visual Studio 2005 targets developers.
  • Globalization and localization for WPF applications is greatly simplified (see WPF Globalization and Localization Overview).

    Ok, why I consider WPF as the intermediate product for the development of Web OS? Don’t you realize that the presentation in WPF is similar to ASP.NET page, Silverlight application? They can use XAML and Express Blend to create amazing UI. Although WPF has some features that fit for desktop application. But it change a lot while comparing to windows forms. It acts like a browser application!