在 WP7 应用程序中显示错误页面 [英] Displaying Error Page in WP7 app

查看:21
本文介绍了在 WP7 应用程序中显示错误页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想检查一下我没有遗漏任何明显的东西.有没有办法从 UnhandledException 处理程序将用户导航到糟糕,发生了不好的事情"页面?

Just want to check I have not missed anything obvious. There is no way to Navigate the user to a "ooops something bad has happened" page from the UnhandledException handler is there?

其他人在做什么

我知道我可以处理"错误并弹出消息框,但我更喜欢整个页面,为他们提供提交错误报告的机会.

I know I can "handle" the error and popup up messagebox but I would prefer a whole page offering them the oppurtunity to file a bug report.

我所看到的示例只是直接设置了 RootFrame,但我已经看到这只会使 UI 看起来像一个页面显示在另一个页面的顶部

The samples I have seen simply set the RootFrame directly but I have seen that just makes for a messy UI with what looks like a Page displayed on top of another page

TIA

推荐答案

如果您收到 UnhandledException,它会在您的应用程序即将关闭时发生.在这种情况下,您可以做的最好的事情是警告用户出现问题(使用消息框或类似方式),但要做好准备,这可能不会长时间显示给用户,具体取决于实际的异常情况.

If you get an UnhandledException it occurs while your applicaiton is about to be shut down. The best you can do in this situation is warn the user that something went wrong (using a messagebox or similar) but be prepared that this may not be displayed to the user for long, depending on the actual exception.

当发生未处理的异常时,与其尝试继续执行应用程序功能,不如简单地保存异常的详细信息.然后,当应用程序下次启动时,向用户显示一条消息,指示该应用程序上次运行时出现问题".您还可以利用这个机会向您自己/您的网络报告服务发送异常详细信息,以便您可以分析问题并在未来版本中修复/防止它们.

Rather than try and continue executing application functionality when an unhandled exception occurs, simply save the details of the exception. Then, when the application is next started, display a message to the user to indicate that "the last time that app ran there was a problem". You can also use this opportunity to send exception details to yourself/ your web reporting service so you can analyse the issues and fix/prevent them in a future version.

这篇关于在 WP7 应用程序中显示错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆