我正在使用PixelSense2.0开发Sur40的应用程序。我正在尝试捕获触摸输入,但是它一直向我提供相同的错误:No overload for method 'GetTouchPoint' takes 0 arguments

到目前为止,这是我的代码:

    void SurfaceWindow1_Loaded(object sender, RoutedEventArgs e)
    {


        this.TouchDown += new EventHandler<TouchEventArgs>(SurfaceWindow1_TouchDown);

    }

    void SurfaceWindow1_TouchDown(object sender, TouchEventArgs e)
    {
        LoadAnimationControl2 ani1 = new LoadAnimationControl2();
        ani1.Margin.Left = e.GetTouchPoint().Position.X;
        ani1.Margin.Bottom = e.GetTouchPoint().Position.Y;
        MainGrid.Children.Add(ani1);
    }


有人建议如何处理这个问题吗?

最佳答案

void SurfaceWindow1_TouchDown(object sender, TouchEventArgs e)
{
    LoadAnimationControl2 ani1 = new LoadAnimationControl2();
    ani1.Margin.Left = e.GetTouchPoint(this).Position.X;
    ani1.Margin.Bottom = e.GetTouchPoint(this).Position.Y;
    MainGrid.Children.Add(ani1);
}

关于c# - 方法'GetTouchPoint'的重载没有接受0个参数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14222387/

10-10 19:03