views:

96

answers:

1

Suppose we have a WPF element, for instance StackPanel with Buttons, Textboxes etc. inside. Is there any way to say directly in XAML that I want a tunneling strategy?

<StackPanel RoutinStrategy="Tunneling" ...
+2  A: 

No - the strategy is defined at the event level. By convention, events prefixed with "Preview" are tunneling, whilst their counterparts are bubbling.

HTH, Kent

Kent Boogaart
Ok thank you! That means that i have to define my custom event. Am I right?
PaN1C_Showt1Me
You haven't really told us what you're doing :) If you want to define your own RoutedEvent, you pass the strategy in when you create it via the EventManager.
Kent Boogaart
Ok thank you. I think that those Preview events should be enough for me. Didn't know that. Thanks once more.
PaN1C_Showt1Me