本文介绍了PreviewMouseMove和MouseMove的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经有了我公平的XAML经验,但是最近我注意到,我的大多数同事使用 MouseMove 事件中的 PreviewMouseMove 。我一直使用 MouseMove ,它为我提供了很好的服务,但是我不禁要问什么时候应该使用 PreviewMouseMove ,而当 MouseMove 。有什么区别,每个人有什么优缺点等等?解决方案
PreviewMouseMove是一个隧道事件,是事件从父容器开始到小孩,MousMove是一个从子元素移动到父子的Bubble事件。有关详细信息,请
I've had my fair share of XAML experience, but recently I noticed that most of my colleagues use PreviewMouseMove insead of MouseMove event. I've always used MouseMove and it has served me well, but I can't help but ask when should I use PreviewMouseMove and when MouseMove. What's the difference, what pros and cons do each have, etc...?
解决方案
PreviewMouseMove is a Tunneling event that is event start from parent container to child and MousMove is a Bubble event that is it move from child element to parent cotainer. for more detail see this
这篇关于PreviewMouseMove和MouseMove的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!