WPF Polygon Questions and Answers (III.)

Source: Internet
Author: User

A Three ways to Route events/policies (Bubbling direct tunneling)

Routed events in WPF are passed along VisualTree and are used to invoke handlers on various listeners on the application's element tree.

(1) Bubbling, this event is handled from the source element to the ancestor flow past until the root node is the top node, generally the outermost control.

(2) Direct, this processing method is processed on the source, mainly used in the source element processing. Usually the setter and trigger, I personally think that the VisualState visual state may also be the direct event processing, but also the state of the dependency property changes. and trigger have a certain repetition, but visualstate is the indirect implementation of the dependency property changes through the blunt animation.

(3) Tunnels, also known as preview events, are handled in the opposite way as bubbling events. The root location of the element tree invokes the event handler, down to the source element position.

Tunnel events and bubbling events are generally paired. The same event, executed first as a tunnel event, followed by a bubbling event.

two · Routed Events (routed event) and Commands (command)

The Event and Command are the foundation of the program's internal communication, and Routed Events can initiate multiple controls and communicate with the user in an orderly manner.

Commands is the core architecture provided by the. NET Framework to activate and remove high-level tasks.

The animation derived from this is the further events. Allows you to use the event schema in a friendly and interactive way, using multiple controls.

WPF Polygon Questions and Answers (III.)

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.