ManipulationDelta事件导致UI冻结或停止响应

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