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.)