ManipulationDelta事件导致UI冻结或停止响应 [英] ManipulationDelta event cause UI Freeze or Stop Responding

查看:61
本文介绍了ManipulationDelta事件导致UI冻结或停止响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了两个滑块控件,并使用ManipulationDelta事件来处理多点触摸事件.并根据滑块的移动进行一些处理.现在的问题是,当我在触摸屏上移动滑块时,对象的画布运动会冻结.

我在某处阅读,优化了外部代码将起作用.但就我而言,我无法在事件外更改代码.

这是我的代码,

I have used two slider control and used ManipulationDelta event to handle multitouch events. and depending on the movement of the slider some process happen. Now the issue is in my canvas movement of the object get freeze when i move my slider through touch screen.

I read somewhere, optimizing the outside code will work. but in my case i am not able to change my code outside the event.

Here is my code,

private void slider_ManipulationDelta(object sender, ManipulationDelataEventArgs e)
{
 slider.value += e.DeltaManipulation.Translation.X;
 Canvas.SetLeft(rectangle, slider.value *2);
}




1)我从事件中删除了所有代码,但在处理多个滑块控件时仍然冻结
2)我有DispatcherTimer来更新Slider.Value
上Canvas上的其他UI元素.
谢谢



Edit :
1) I have removed all code from event but still it is freeze when dealing with multiple slider control
2) I have DispatcherTimer to update other UI element on Canvas on slider.Value

Thanks

推荐答案

我认为您应该使用MultiThriding
i think you should use MultiThriding


这篇关于ManipulationDelta事件导致UI冻结或停止响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆