Closed Sally-Xu closed 9 years ago
https://msdn.microsoft.com/en-us/library/ms742806(v=vs.110).aspx#concept_handled
Handled does not prevent bubbling. It's only used to notify others that an event was handled.
I believe setting e.Handled = true stops the even bubbling in Silverlight (after version 2, it was a different story earlier than version 2).
http://silverlight4tutorials.blogspot.com/2010/05/silverlight-events.html
Maybe it is different in WPF?
Either way is fine, as long we have a consistent pattern so we can code the event handler accordingly, such as always check if e.Handled == true.
Looks like setting e.Handled = true doesn't prevent event from bubbling up. Test case: When click a menu item in ContextMenu, both OnMouseLeftButtonDown and _HandleOverlayMouseButtonDown are fired, even the e.Handled = true was set in OnMouseLeftButtonDown event handler and was fired first.