windows-phone-7 - 参数不正确。在 MS.Internal.XcpImports.MethodEx(IntPtr ptr,字符串名称,CValue[] cvData)

标签 windows-phone-7 exception back

在 Wp7 上,当用户在显示手机键盘时按下页面上的“开始”按钮并点击设备后退按钮时,应用程序崩溃,异常为:-

The parameter is incorrect. 
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.Controls.SipHelper.AdjustFrame(FrameworkElement element, Double bottomMargin, Double& stillObscured)
   at System.Windows.Controls.SipHelper.SelectionChanged(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

我无法理解异常是从哪里生成的。

谢谢, 金谷

最佳答案

发生这种情况是因为您在页面布局中添加了两次控件,或者向其父级添加了两次任何对象。检查 OnNavigedTO 方法中的代码。当您返回页面时,OnNavigedTo 会再次执行,因此如果您添加任何对象到 OnNavigedTo 方法中的父对象,那么您应该在 OnNavieratedFrom 函数中从父对象中删除该对象

关于windows-phone-7 - 参数不正确。在 MS.Internal.XcpImports.MethodEx(IntPtr ptr,字符串名称,CValue[] cvData),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10484856/

相关文章:

c# - WP7 InvokeScript 错误

c# - WP7 应用程序 : Too large page

java - 为什么不抛出异常的代码允许捕获已检查的异常?

react-native - React Native - 设备后退按钮处理

windows-phone-7 - Windows phone 闸机羽化页面过渡

c# - 使用可观察的地理坐标集合在 WP7 的 bing map 上绘制路线

c++ - 在 g++ 中使用异常

swift - “ fatal error :在展开可选值时意外发现nil”是什么意思?

javascript - Safari 9 中后退按钮后触发 JQuery/Javascript

iPhone 后退按钮文本 iOS5+ 未显示?