How To Disable Inertia in ScatterView

2019-08-06 08:44发布

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.

So I try this...

   ScatterviewItem svi = new ScatterviewItem();
   svi.ManipulationDelta += OnManipulationDelta;

...

    void OnManipulationDelta(object sender, ManipulationDeltaEventArgs args)
    {
        if (args.IsInertial)
        {
            args.Complete();
            args.Handled = true;
        }
    }

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?

4条回答
我只想做你的唯一
2楼-- · 2019-08-06 08:48

A deceleration rate of 0 will also work

查看更多
对你真心纯属浪费
3楼-- · 2019-08-06 09:00

Not sure why your event is not firing. Another solution is for you to set the deceleration rate of the ScatterViewItem to a suitably high value.

查看更多
闹够了就滚
4楼-- · 2019-08-06 09:00

The event handler is for when the ScatterView is manipulated. Each item added to the ScatterView would need to have the handler set the same way, which you should be able to do by creating a template for the ScatterViewItem class, or if you're using an ItemsControl, through the item template there.

查看更多
Root(大扎)
5楼-- · 2019-08-06 09:05

Try using a handler for the ContainerManipulationDelta event instead of the ManipulationDelta event

查看更多
登录 后发表回答