Why e.Handled = true not working?

你说的曾经没有我的故事 提交于 2019-11-29 03:59:19

The MouseEnter event is not a bubbling event, it is a direct event (like classic CLR events). From the documentation:

You can define multiple MouseEnter events for objects in XAML content. However, if a child object and its parent object both define a MouseEnter event, the parent object's MouseEnter event occurs before the child object's MouseEnter event. This is not a case of a bubbling event; it indicates only that the mouse (or stylus) has entered both objects, potentially at different times depending on the layout and the composition of the visual tree.

So you can't prevent it from being fired on the parents. You can use the IsMouseDirectlyOver property to see if the mouse is in fact only over the given element though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!