$title =

Event Bubbling on Click Event in Silverlight

;

$content = [

A routed event is an event that traverses the object hierarchy from the element that triggers the event up to each of its parent objects. Events are bubbled up. But not all framework elements support routed events – the framework elements that support routed events are:

  • KeyDown
  • KeyUp
  • MouseEnter
  • MouseLeftButtonDown
  • MouseLeftButtonUp
  • MouseMove
  • BindingValidationError

Just for the fun of it, imagine that we put a button as content of another button. Both buttons have a click event. What will happen if we click the inner button? Will both click events be fired or just the click event for the inner button?

<Button Click=”OuterButton_Click”
Width=”200″ Height=”100″>
<Button Click=”InnerButton_Click”
Width=”150″ Height=”75″
Content=”Click Me” />
</Button>

Only our inner click event will be fired. Control specific events don’t bubble – including the click event for the button control. Why propagate an event through the tree, when it can be handled only by a specific type of controls?!

by xamlgeek.dk

];

$date =

;

$category =

;

$author =

;