如何在 ScatterView 中禁用惯性 [英] How To Disable Inertia in ScatterView
本文介绍了如何在 ScatterView 中禁用惯性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 Windows Touch WPF 中附带的 ScatterView 控件.我想防止在 scatterview 项目上发生惯性.但我仍然希望允许用户移动、缩放和旋转项目.
Using ScatterView control shipped in Windows Touch WPF. I want to prevent inertia from happening on a scatterview item. But I still want to allow user to move, scale and rotate the item.
所以我试试这个...
ScatterviewItem svi = new ScatterviewItem();
svi.ManipulationDelta += OnManipulationDelta;
...
void OnManipulationDelta(object sender, ManipulationDeltaEventArgs args)
{
if (args.IsInertial)
{
args.Complete();
args.Handled = true;
}
}
但事件永远不会触发.我是不是做错了什么,或者有其他方法可以做到这一点,还是 scatterview 根本不可能防止惯性?
But the event is never firing. Am I doing something wrong, or is there another way to do this, or is preventing inertia simply not possible with scatterview?
推荐答案
尝试使用 ContainerManipulationDelta
事件的处理程序代替 ManipulationDelta
事件
Try using a handler for the ContainerManipulationDelta
event instead of the ManipulationDelta
event
这篇关于如何在 ScatterView 中禁用惯性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文