忽略 WPF 中触摸事件的元素
Ignore element for touch events in WPF
我有一个 Window
,其中包含两个 Image
元素:背面和正面。显然,Front 的 Z-index 比 Back 高。我在 Back 上也有 TouchMove
处理程序。但是当触摸点的 Back 与 Front 重叠时,事件不会触发。那么,如何通过触摸来忽略前面呢?
如果您希望触摸或单击事件传递到底层控件,请在 Front Image 上将 IsHitTestVisible 设置为 false。
Here's more information 关于 UIElement 上的命中测试的工作原理。
我有一个 Window
,其中包含两个 Image
元素:背面和正面。显然,Front 的 Z-index 比 Back 高。我在 Back 上也有 TouchMove
处理程序。但是当触摸点的 Back 与 Front 重叠时,事件不会触发。那么,如何通过触摸来忽略前面呢?
如果您希望触摸或单击事件传递到底层控件,请在 Front Image 上将 IsHitTestVisible 设置为 false。
Here's more information 关于 UIElement 上的命中测试的工作原理。