Visual \ uielemnt \ frameworkelement \ Control

Source: Internet
Author: User

Visual

Visual
It is actually the entry point of the WPF combination system. Visual
It is the connection point between managed APIs and unmanaged milcore subsystems.

Visual Objects support the following features:

  • Output display: displays the persistent serialized drawing content of the visual object.
  • Conversion: converts a visual object.
  • Editing: supports the editing area for visual objects.
  • Hit test: determines whether the specified coordinate (point) or ry is included in the boundary of the visual object.
  • Border box calculation: determines the border of the visual object. Uielement

Uielement
Define core subsystems, including layout, input, and event.

Layout

Layout is a core concept in WPF. In many systems, there may be a set of fixed layout models (HTML supports three layout models: stream, absolute, and table), or there may be no layout model (USER32 actually only supports absolute positioning ). WPF assumes that developers and designers want to have a flexible and scalable layout model, which may be driven by attribute values rather than imperative logic. In uielement
Level, will introduce the basic layout agreement-with Measure
And arrange
The two-phase model of the processing process.

Input

Touch \ mouse \ stylus \ keyboard

The input is sent as a signal on the driver of the kernel-mode device and routed to the correct process and thread through a complex process involving the Windows Kernel and USER32. After the USER32 message corresponding to the input is routed to WPF, it is converted to the original input message of WPF and sent to the scheduler. WPF allows you to convert original input events to multiple actual events, allowing you to implement a function similar to "mouseenter" at a lower system level while ensuring that the input events are passed in place.

Event

Preview tunnel routing event vs bubble event

If an event traverses the tree from the target to the root, it is called "Bubbling". If it traverses down from the root to the target, it is called a "Tunnel ". Enter the preview event tunnel so that any element in the tree has the opportunity to filter events or take actions on events. Then, the general (non-Preview) event will bubble up from the target to the root.

Inheritance hierarchy

System. Object
System. Windows. Threading. dispatcherobject
System. Windows. dependencyobject
System. Windows. Media. Visual
System. Windows. uielement
System. Windows. frameworkelement

 

Frameworkelement

A)
Application Layout

Frameworkelement
The main strategy introduced is application layout. Frameworkelement
Based on uielement
Built on the basic layout introduced, and added the concept of "slots" for layout creators to conveniently have a set of consistent and Attribute-driven layout semantics. Horizontalalignment, verticalignment, minwidth
And margin
Such
All derived components have consistent behavior in the layout container.

B)
Animation

C)
Data Binding Template

D)
Style

Control

A)
Common attributes

Control
Provides a set of common attributes, such as foreground, background, and padding.
Template creators can use these common attributes to customize the display of controls. Controls provide a data model and an interactive model. The interactive model defines a set of commands (such as window "close") and binding to the input pen potential (such as clicking the Red Cross in the window ). The data model provides a set of attributes for customizing the interaction model or custom display (determined by the template ).

B)
Model

The data model (attribute), interactive model (command and event), and display model (Template) are divided so that you can completely customize the appearance and behavior of the control. The most common control data model is the content model.

Related Article

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.