导航页面时出现 UnhandledException 0x8000ffff
我是 WP7 应用程序的新手,面临一个奇怪的问题。当我从一个页面导航到另一页面时,我的应用程序崩溃了。它适用于特定场景,但在其他两种情况下会失败。 我附上源代码供参考,希望能找到解决方案。我还查看了其他线程,看看我做错了什么,但找不到它。以下是生成问题的步骤:
- 运行应用程序后,单击“Water”,页面将导航到“WebPage.xaml”并加载相应的 Web 内容。
- 现在单击模拟器上的“后退”按钮,您将看到与“水”及其描述相同的屏幕。
- 它按预期工作。
- 现在单击指向“右”的箭头,新内容将加载到同一“MainPage.xaml”上,其中包含“甲烷”的详细信息。
- 单击“甲烷”导航并加载“WebPage.xaml”,其中包含“甲烷”的网页内容。
- 现在单击模拟器上的“后退”按钮,应用程序崩溃。我想知道相同的过程或步骤适用于“水”,但不适用于“甲烷”。
这是捕获的内部异常...“无法评估表达式” 和堆栈跟踪...
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
I am new to WP7 application and facing a strange issue. My application crashes when I navigate from one page to other. It works for a specific scenario and fails in other two cases.
I am attaching source code for reference and hoping for a solution. I also looked at the other thread to see what am I doing wrong but could not find it. Here are steps to generate the issue:
- After running the application, click on “Water” and page will navigate to “WebPage.xaml” and will load respective web content.
- Now click on “Back” button on the emulator, you will get same scree with “Water” and its description.
- It works as expected.
- Now click on arrow pointing towards “Right”, a new content will load on same “MainPage.xaml” with details of “Methane”.
- Click on “Methane” to navigate and load “WebPage.xaml” with web content of “Methane”.
- Now click on “Back” button on emulator and application crashes. I am wondering same process or steps works fine with “Water” and fails for “Methane”.
Here is the Inner Exception caught... "Could not evaluate expression"
and Stack Trace...
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论