1

Wpf 多指应用开发解析 - terry119

 2 years ago
source link: https://www.cnblogs.com/terryK/p/16498311.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Wpf 多指应用开发解析

1  首先分析多指事件与单指事件,以及执行顺序

1787922-20220720153034384-1884075482.png

2  事件阻断

订阅多指事件后,在TouchDown时 采用e.handle = true,阻断多指事件,或在ManipulationStarting、ManipulationStarted 时调用参数(ManipulationStartingEventArgs e)、(ManipulationStartedEventArgs e)e.cancel(); 但注意不可以在ManipulationDelta的参数( ManipulationDeltaEventArgs e)调用e.cancel(),否则之后也不会触发ManipulationDelta 事件

3  当触摸有多指的时间再去监听(不是在一开始或 第一指按下就就监听多指事件,而是在触摸之后再去监听),则不会触发ManipulationStaring 和ManipulationStarted 事件,为什么?只能查看源代码了...

1787922-20220720154157982-1424790977.png

 

1787922-20220720154249086-1358445192.png

 

1787922-20220720154303132-595490580.png

 

通过源代码发现: 第一指手指 触摸的时候 为Waiting 状态,第二指手指再按下 监听的时候为Manipulating状态,所以在第二指触控之后再去监听多指事件,则多指事件不会触发 ManipulationStarted事件。而在第一指按下就监听的时候,可以正常触发了

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK