UWP 相当于 ManipulationDelta Cancel
UWP Equivalent to ManipulationDelta Cancel
在 WPF4 中,可以通过调用 ManipulationDeltaEventArgs.Cancel() 取消操作事件并将其转发回鼠标事件。
我希望能够在 UWP / Windows10 中做同样的事情,但 ManipulationDeltaRoutedEventArgs 上没有这样的取消方法。
MSDN 文档指的是 cancellation of a manipulation ...
Manipulation gesture events, such as ManipulationStarted, indicate an ongoing interaction. They start firing when the user touches an element and continue until the user lifts their finger(s), or the manipulation is canceled.
...但没有告诉您实际如何做:?
您可以在您指定的 UIElement
上取消它。
element.ManipulationDelta += OnManipulationDelta;
...
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var element = (UIElement)sender;
element.CancelDirectManipulations();
}
在 WPF4 中,可以通过调用 ManipulationDeltaEventArgs.Cancel() 取消操作事件并将其转发回鼠标事件。
我希望能够在 UWP / Windows10 中做同样的事情,但 ManipulationDeltaRoutedEventArgs 上没有这样的取消方法。
MSDN 文档指的是 cancellation of a manipulation ...
Manipulation gesture events, such as ManipulationStarted, indicate an ongoing interaction. They start firing when the user touches an element and continue until the user lifts their finger(s), or the manipulation is canceled.
...但没有告诉您实际如何做:?
您可以在您指定的 UIElement
上取消它。
element.ManipulationDelta += OnManipulationDelta;
...
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var element = (UIElement)sender;
element.CancelDirectManipulations();
}