Winform vs WPF, COM/COM + vs. Net assembly, COM/COM + in ASP. NET ,... ...

Source: Internet
Author: User
Winform vs WPF

Where is the advancement of XAML?

XAML
I personally think that XAML should be an epoch concept in WPF. With XAML, we can describe complex object graphs in text mode. Through command, routing event, and other mechanisms, the interface designer andProgramEmployees have clear boundaries.

Dependency Property
In winform development, the common problem is that the value of a control changes, and other controls also change. The solution is not to writeCodeIf it is not through data binding, the interface and code generation cannot be separated, and the latter is not flexible enough. In this regard, WPF can easily associate relevant attributes through XAML, and implement complex binding relationships through extension.

Solve the window handle Problem
Each winform ControlIs a small window, will useWindow handle,May encounterOut of memoryOr"Error create window handle"And cause the program to exit.WPFThe display mode of the control is completely changed, and the control will not be occupied if it is not in the window.Window handle. Theoretically, ifWPFIf there is only one main window,WPFOnly oneWindow handle(If ignoredDispatcher). SoWPF GuiThe program does not appearWindow handleInsufficient.

Multi-thread processing

During winform program development, one of the biggest headaches is that worker the program crashes when the thread modifies the properties of the control, in addition, this illegal operation does not fail every time. the winform Control provides invokerequired attribute to determine whether the current thread is a control creation thread. The problem is that when the control tree is deep, this attribute will be slow.
WPF at the beginning of the design, multithreading was taken into account. Most of the WPF classes inherit from dispatcherobject . dispatcherobject it is actually true for dispatcher . dispatcher provides invokerequired . This method only compares the thread id , so it will be very fast. In addition, dispatcher provides priority queues for asynchronous calls, timer and other functions simplify the development of multithreading GUI program.

to be...

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.