Selection of WPF and winform

Source: Internet
Author: User
Microsoft once held great expectations for WPF (code-named aveon)-a new generation of gorgeous User Interface platform, unified web applications and desktop applications, flash killer, although Microsoft does not verbally admit it. Over the past few years, WPF has indeed implemented most of the expected functions, but it is still far from the field of software development. However, developers who have just transferred to winform for a year or two are confused that there is no future for winform. Microsoft only vaguely said that it is winform in the short term and WPF in the long term. Think about Venus, tabletpc, hailstorm, and IE channels. In the end, the benevolent wise sees wisdom.

English DevelopmentCommunityThe popular term "no silver bullet" means that there is no omnipotent solution. No tool or method can solve all problems perfectly. This also applies to WPF. As a substitute for winform, WPF is more like DHTML and ASP. NET. To put it bluntly, if you want to draw a family tree for Microsoft's technology, DHTML is the immediate family member of WPF. A large number of core concepts and structures in WPF, such as attribute engines and event models, are inherited from DHTML. The biggest difference is the separation of appearance and control logic. The similarity between WPF applications and DHTML applications (HTA) is also very large. The difference is that WPF applications can be completely different from IE. That is to say, WPF and web pages, ASP. NET, and SVG are a set of systems, which can be compared to flash in XML version, but completely different from winform. The long term of WPF should be a webpage-based application. Of course, it can also be used for other things, just like Ajax can be used as an online text editor.

Some people may have heard of DHTML. DHTML is dynamic HTML, which was extended by Microsoft in ie4 at the end of 1990s. Its main feature is that it can dynamically modify the attributes of objects on the web page and has a timeline similar to that in flash, dynamic Web pages can be created. The disadvantage is that it is difficult to develop and debug. Later, it was mainly used as a flip button. A DHTML page set can be packaged into an HTA application together with Script resources. The HTA application can be used on the local machine and on the network. But from now on, many people remember that DHTML knows that this is not a success.

Back to WPF, WPF only provides complete support on XP and Vista. In other platforms and browsers, Microsoft provides WPF/E (development code ). WPF/EProgramNon-compiled, that is, source code is released, just like HTML and JavaScript. In addition, WPF/e currently only supports JavaScript. You will understand what applications WPF/ecan be used. To choose between WPF/E and flash, you just need to think about the differences between XML and compressed binary files. Currently, a few megabytes of Flash are everywhere. How big is it if you use XML format, you understand. However, for a web form application, WPF/E is indeed more powerful than flash, but Ajax is in place, and it may not be necessary to kill chickens. If your application only supports XP and Vista, you can get all the advantages of WPF.

WPF has three application modes: application, browser application, and document application. An application is a common window application. A browser application is a page-by-page application like a web page. A document application is a subset of browser application functions used to display content, rather than the MVC model. Generally, each page has an independent window. It is estimated that the VB user thought of the HTML control for that year, and the Delphi user thought of intraweb. A simple understanding is to replace the winform interface with a Web page. Of course, this web page is much more powerful and complex than HTML.

WPF is a complex system, and its interface can be usedCodeGeneration, but most people use XAML to generate. XAML can be considered as the HTML of WPF. People who develop standards always say that XML is readable, but most people think it is used for machine reading. Xmal is based on XML and has made some extensions to make up for the shortcomings of the functions. To write XAML manually, you must understand WPF, XML (namespace, link, and so on), understand the rules of XAML, understand the syntax of XAML extensions, and remember a large number of identifiers and references. Just like today, most people no longer write HTML, most people do not want to write more complex XAML. In addition, according to Microsoft's design goals, WPF should separate the interface design and program logic and hand it over to different professionals. That is to say, the interface design should be handed over to the artist. Believe me, it is difficult to find an artist who can hand-Write the XAML. For this reason, Microsoft provides the expression series software, which is not free of charge. Of course, Visual Studio also has a certain degree of support, but this means that programmers can make flexible and complex interfaces, making it easier to make ugly interfaces; or let artists use Visual Studio, limited functionality and a little expensive. Of course, there may also be a good UI programmer who has the best of both worlds. Or, you can honestly make a simple interface, and you will have the opportunity to find an artist to polish it later.

Programmers like to talk about speed. WPF supports hardware acceleration. When DirectX 9-level graphics cards and newer drivers are installed, WPF will get partial or complete hardware acceleration. Winform is based on GDI + and has no hardware acceleration. Only texts in the incompatible mode of V2.0 are accelerated through GDI. Therefore, in the long run, WPF has better performance.

Now back to the initial question: WPF and winform, which side should the bet be placed on. Editor programs are difficult to transplant to WPF, such as world, Excel, PowerPoint, Photoshop, and IDE. Display and general business applications can be transplanted, and existing Web applications can be transplanted. That is to say, the application scope of WPF is greatly coincident with Ajax and Flash. The competitiveness of WPF is the integration with code. As Adobe stepped up its FLASH application feature upgrade, one possible result was that WPF and flash compressed the Ajax living space, and WPF/e did not receive sufficient support, WPF has become a dedicated application for Windows, and Flash exists as a cross-platform solution. For winform programs, it is easy to embed some WPF content. Winform is still the most secure way for general applications at present when the future of WPF is unknown.

From: http://hi.baidu.com/%C7% AB %D0%E9%B5%C4%CC%EC%CF%C2/blog/item/7972aa1f965736cba78669b9.html

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.