如何在Windows Phone中禁用多点触控?

时间:2013-08-18 08:24:53

标签: c# silverlight windows-phone-7 touch

我曾经使用鼠标事件,使用TouchFrameReported,我希望它是单点触控,但它支持多点触控,如何禁用多点触控,在触摸帧报告,或者是否有任何想法实现,以便不支持多点触控。

void Touch_FrameReported(object sender, TouchFrameEventArgs e)
        {
            foreach (TouchPoint touchPoint in e.GetTouchPoints(this.mainGrid))
            {
                if (touchPoint.Action == TouchAction.Down)
                {
                    currentPoint.X = touchPoint.Position.X;
                    currentPoint.Y = touchPoint.Position.Y;
                    glowDot();
                }
                else if (touchPoint.Action == TouchAction.Up)
                {
                    circPathGlow.Visibility = Visibility.Collapsed;

                }
                else if (touchPoint.Action == TouchAction.Move)
                {

                }
            }
        }

2 个答案:

答案 0 :(得分:1)

您可以在以下网址找到更多相关信息:

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/123e9381-fc0b-441e-a738-dcd35f526a6e/how-to-disable-multitouch

  

我不会试图在这里触摸触摸信息。如果目标是   一次将拖动限制为一个控件,然后将其限制为   控制。一旦一个人移动,就不要移动其他人。

     

在指针消息级别,您可以跟踪PointerId   PointerPressed并忽略其他PointerIds,直到你得到一个   PointerReleased或PointerCaptureLost:

问题:您要禁用某些多手势还是全部?

答案 1 :(得分:0)

阅读http://www.wintellect.com/blogs/jprosise/building-touch-interfaces-for-windows-phones-part-2后 我开始知道我正在使用e.GetTouchPoints 而不是e.GetPrimaryTouchPoint ,,
现在,我使用e.GetPrimaryTouchPoint,它只捕获被触摸的第一个触摸点,
TouchPoint touchPoint = e.GetPrimaryTouchPoint(this.mainGrid); 和其余的代码,这解决了我的问题。

相关问题