鼠标双击触发用户控件和窗口 [英] Mouse double click triggering for both user control and window
本文介绍了鼠标双击触发用户控件和窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的WPF上使用MVVM,我有一个窗口,有3个用户控件,窗口和用户控件有双击事件。当我在用户控件上加倍时,它会触发用户控制点击事件,然后触发窗口点击事件。我该如何避免这种情况?
我的尝试:
i搜索谷歌,但我没有任何东西。请帮助我...
In my WPF am using MVVM , i have a window in it there are 3 user control , window and user control having double click event . when i double on user control first it trigger user control click event and then window click event. How can i avoid this?
What I have tried:
i searched google , but i didn't anything .please help me...
推荐答案
这将帮助您了解正在发生的事情以及事件冒泡的原因以及如何处理它们: RoutedEventArgs |关于WPF应该了解的2,000件事情 [ ^ ]
如果您仍然遇到困难,请点击改善问题在您的问题中发布您的代码。
This will help you understand what is happening and why events are bubbling up and how to "Handle" them: RoutedEventArgs | 2,000 Things You Should Know About WPF[^]
If you are still experiencing difficulty, please post your code in your question by clicking on Improve question.
>
这篇关于鼠标双击触发用户控件和窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文