Routed events (RoutedEvent) is a new event in WPF that is not very different from traditional events,
But the way of transmission is completely different.
How routed events are propagated
Define the way to propagate through routingstrategy
Public enum RoutingStrategy { 0// Tunnel, propagated inward by top-level elements, events typically start with preview 1 // bubbling, contrary to the tunnel, spreading outward 2 // Direct, similar to a traditional event }
The most common routing events in WPF are tunnel and bubble, so the general routed events are paired,
such as:Previewmouseleftdown and mouseleftdown
Note: The tunnel event is always executed first than the bubble event, and if Handled = True is set in the tunnel event, the paired bubble event will not occur. Because they share an instance of the same RoutedEventArgs class, Handled = True is set during retransmission, the routed event continues to propagate, but it is not executed.
For more detailed information, please refer to:
WPF QuickStart Series (3)--in-depth parsing of the WPF event mechanism
Propagation of events in the middle of a WPF route