Not sure, but you may be wanting a cat to bark.
The RoutedEvent ClickEvent of Button (from PresentationFramework) is declared as:
public static readonly RoutedEvent ClickEvent =
EventManager.RegisterRoutedEvent("Click",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof
(ButtonBase));
Note the readonly
RoutingStrategy
of Bubble
.
The following may help with understanding Tunnel, Bubble, and Direct:
msdn.microsoft.com/en-us/library/system.windows.routingstrategy.aspx
And this should take you the rest of the way:
msdn.microsoft.com/en-us/magazine/cc785480.aspx
A tip: by convention tunneling events in WPF begin with "Preview" (e.g.- "PreviewExplode". If the event doesn't begin with "Preview" it probably doesn't use the tunnel RoutingStrategy. Also you will usually see a Tunnel and Bubble paired with the Tunnel firing first then the Bubble as in "PreviewExplode" followed by "Explode".
If you need to have a Button's Click tunnel, you might consider
- using PreviewMouseDown (not the same of course and likely dangerous since not all mouse-downs are meant to become clicks).
- Writing a TunnelButton that raises a PreviewClick and then a Click.