Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WinRT PointErrorutedEventArgs.GetCurrentPoint方法引发ArgumentException_C#_Windows Runtime_Touch_Windows 8.1 - Fatal编程技术网

C# WinRT PointErrorutedEventArgs.GetCurrentPoint方法引发ArgumentException

C# WinRT PointErrorutedEventArgs.GetCurrentPoint方法引发ArgumentException,c#,windows-runtime,touch,windows-8.1,C#,Windows Runtime,Touch,Windows 8.1,我在C#for Windows 8.1中开发了一个多点触摸WinRT应用程序,并在Surface Pro 2上进行了测试。 我连接到主页上的PointerMoved事件。在收到的PointErroredEventsArg上,我调用GetCurrentPoint,并指定MainPage作为参数。对于大多数情况,这是有效的,对于一些情况,我会得到一个参数异常 Exception:Thrown: "Wrong parameter". Failed to get pointer information

我在C#for Windows 8.1中开发了一个多点触摸WinRT应用程序,并在Surface Pro 2上进行了测试。 我连接到主页上的PointerMoved事件。在收到的
PointErroredEventsArg
上,我调用
GetCurrentPoint
,并指定
MainPage
作为参数。对于大多数情况,这是有效的,对于一些情况,我会得到一个
参数异常

Exception:Thrown: "Wrong parameter". 
Failed to get pointer information.
WinRT information: Failed to get pointer information.

GetCurrentPoint
的上下文中,此错误意味着什么?为什么它对某些点有效,但对其他点无效?最后,如何解决这个问题?

我犯了在应用程序中存储PointErrorutedEventArgs对象的错误。很明显,WinRT重用了这些对象,因此每当在调用GetCurrentPoint之前重用对象时,我都会遇到异常。解决方案是在PointErrorutedEventArg对象可用时立即调用GetCurrentPoint,并存储结果点数据