我一直在试图解决这个问题,但好像一直没有进展。我想要在用户开始滚动时停止计时器,在用户停止滚动时重新启动计时器。我尝试使用Manipulation事件,但似乎根本不会触发。是否有人知道我需要连接的事件,或者是否有更好的方法解决这个问题?
谢谢。
谢谢。
public MainPage()
{
InitializeComponent();
TouchPanel.EnabledGestures = GestureType.FreeDrag;
Touch.FrameReported += Touch_FrameReported;
}
private void Touch_FrameReported(object sender, TouchFrameEventArgs e)
{
if (TouchPanel.IsGestureAvailable) // check only dragging
{
// get point relative to Viewport
TouchPoint mainTouch = e.GetPrimaryTouchPoint(yourMap);
// drag started Key - down
if (mainTouch.Action == TouchAction.Down)
timer.Stop();
// check if drag has completed (key up)
if (mainTouch.Action == TouchAction.Up)
{
timer.Start();
// in both cases you can use some other Properties of TouchPoint
// do something for example dependant on coordinates
// double x = mainTouch.Position.X;
// double y = mainTouch.Position.Y;
}
}
}