我找到的最佳答案是听 ManipulationComplete 以获取用户正在抬起最后一根手指的通知。但是,在那之后你仍然会得到一些拖尾的触摸帧。所以我们需要忽略它们......我只是忽略了它们的下一秒,但这可能是矫枉过正。
public MainPage()
{
...
ManipulationCompleted += OnManipulationCompleted;
...
}
private void OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
OnFrameReported(this, null);
m_whenStopIgnoringTouchEvents = Environment.TickCount + 1000;
}
private void OnFrameReported(object sender, TouchFrameEventArgs e)
{
if (e != null)
{
if(Environment.TickCount > m_whenStopIgnoringTouchEvents)
{
// null indicates the touch point information is relative to the
// top left corner
var args = e.GetTouchPoints(null);
...
}
}
}
private int m_whenStopIgnoringTouchEvents = 0;