在wpf中集中管理异常处理 [英] centralized management of exception handling in wpf

查看:77
本文介绍了在wpf中集中管理异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在WPF中找不到主要功能。所以,我不知道在WPF中集中处理异常。在winform中很容易,因为main函数在program.cs中。

任何帮助都将不胜感激。

Hi,
I don't find main function nowhere in WPF. So,I have no idea to handle exception centrally in WPF. In winform it is quite easy since main function is in program.cs.
Any help will be greatly appreciated.

推荐答案

您可以处理 DispatcherUnhandledException 事件你的申请。

你可以在这里看到一个例子: http://www.wpf-tutorial.com/wpf-application/handling-exceptions/

You can see an example for it here: http://www.wpf-tutorial.com/wpf-application/handling-exceptions/.


如何集中使用试试和捕捉操作
how to use centralized in try and catch operation


这篇关于在wpf中集中管理异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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