views:

38

answers:

1

Hi all, I read this good article about Routed Events, and I understood why we need sometimes bubble Events and sometime we need tunnel Events.

What I didn't understand is, when we use the tunnel Event, why after it is handled or reached to the source element, still the bubble event is launched?

Thanks in advance!

+1  A: 

The article says that if you put an image on a button, and that image is clicked, the tunnel event for that image will fire. But it is highly likely that you would also want to handle that click as if the button itself was clicked, so a bubble event is also fired which bubbles up to the click event on the button itself (because the button owns the image), so that you can treat the image click like a button click, using the usual event handler for the button.

Robert Harvey