Traditional Culture Encyclopedia - Traditional stories - The difference between Winform and WPF and the specific use of WPF
The difference between Winform and WPF and the specific use of WPF
The WinForm control provides an InvokeRequired property that determines whether the current thread is the thread that created the control. Once the control is created, InvokeRequired is efficient and safe. However, if the target control has not yet been created (the C# object already exists, but the underlying window handle is still null), then InvokeRequired can take a long time. (It traverses the control tree from bottom to top until it finds a parent control that can host the control and has already been instantiated and created, which ensures that the child control will be created in the same thread as the parent control. Once a suitable parent is found, the framework performs the same check, comparing the ID of the current thread with the ID of the thread that created the parent control.) If the framework is unable to find any of the created parent forms, then it needs to find some other type of form. If you can't find a form available in the hierarchy, then the framework will start looking for a parking window, which allows you not to be distracted by the strange behavior of some Win32 APIs. In short, some changes to a form (such as modifying some styles) require that the form be destroyed and recreated. A staging form is used to temporarily save the controls in the parent form while it is being destroyed and recreated. During this time, the UI thread runs only in the staging form.
Usually, WPF applications start with two threads: one for handling presentation and one for managing the UI. The presentation thread runs effectively hidden in the background, while the UI thread receives input, handles events, draws the screen, and runs the application code.
WPF is an acronym for Windows Presentation Foundation, which was originally code-named "Avalon", and because of the same combination of pinyin initials as "I'm impressed", some people in China have flirtatiously called it "I'm impressed". WPF is Microsoft's new generation of graphics systems, running under the .NET Framework 3.0 architecture, which provides a unified description and operation method for user interfaces, 2D/3D graphics, documents and media. Based on DirectX 9/10 technology, WPF not only brings unprecedented 3D interface, but also its graphics vector rendering engine greatly improves the traditional 2D interface, such as Vista in the semi-transparent effect of the form and so on are thanks to WPF. Programmers in the help of WPF, to develop a cool interface comparable to Mac programs is no longer a distant luxury. NET UI framework, integrated vector graphics, rich flow text support flow text support, 3D visual effects and a powerful control modeling framework.
- Previous article:Is Qingdao Ecotech a training institution?
- Next article:What are the achievements of painting art in Qing Dynasty?
- Related articles
- What is the idea of red culture exhibition hall design and construction?
- What should I pay attention to when joining a hair care center?
- How big is the float for fishing crucian carp?
- Exploring the teaching styles and characteristics of science lessons
- How to understand Renai Renai is the core of Confucius' thought, embodying the most fundamental value of Confucianism.
- Luckin coffee's counterattack
- Famous sayings about collective action
- What materials are used for traditional grass carp fishing?
- What is cloisonn¨¦
- How to write the school year work plan?