views:

17

answers:

1

I have UserControls within UserControls in WPF. This makes a tree structure starting from the root node.

I want to register for the event MouseLeftClickDown in all the UserControls. Left Clicking on a child control causes the event to fire for that control and all the parent controls that contain that child.

When I click a child, I don't want to fire the event for any parent controls, I just want it to fire for the child control clicked.

+1  A: 

You could use the MouseDownEvent. The MouseEventArgs passed to the handler should have a Handled property that if it is set to true indicates that the event should not be passed on to the controls higher up in the hierarchy.

Obalix