RoutedEvents

I have an user control with MouseDoubleClick handler declared. The problem is that if I double click a child the usercontrol's MouseDoubleClick fires, but, I don't want that. How can I manage this?

Thanks

[214 byte] By [CornelGav] at [2008-1-4]
# 1

Inside the user control's MouseDoubleClick handler, check the sender.

Only proceed if the sender is the user control.

FastBilly at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

Sorry, my last post didn't really answer your question and now I can't delete it. Depending on your situation, though, it will probably give you the desired effect.

FastBilly at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
I want that for some childs the event to fire up and for others not.
CornelGav at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 4
If the children handle the event, it will not bubble up to your UserControl. They state that they have handled the event by setting e.Handled to true in their handling code. If the event reaches your UserControl you can check e.Source or even e.OriginalSource to see what actually trigger the event, and whether the continue processing.
TimDawson at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified