语言

Dispatcher.UnhandledException 活动

定义

在通过委托执行期间或以某种Invoke方式BeginInvoke引发和未捕获线程异常时发生。

public:
 event System::Windows::Threading::DispatcherUnhandledExceptionEventHandler ^ UnhandledException;
public event System.Windows.Threading.DispatcherUnhandledExceptionEventHandler UnhandledException;
member this.UnhandledException : System.Windows.Threading.DispatcherUnhandledExceptionEventHandler 
Public Custom Event UnhandledException As DispatcherUnhandledExceptionEventHandler 
Public Event UnhandledException As DispatcherUnhandledExceptionEventHandler 

事件类型

注解

当通过或未捕获委托InvokeBeginInvoke执行期间引发的异常时,将引发此事件。

处理程序可以将异常标记为已处理,这将阻止调用内部异常处理程序。

必须谨慎编写此事件的事件处理程序,以避免创建辅助异常并捕获发生的任何异常。 建议避免在处理程序中分配内存或执行任何资源密集型操作。

该 UnhandledExceptionFilter 事件提供了一种不引发 UnhandledException 事件的方法。 首先UnhandledExceptionFilter引发该事件,如果RequestCatch设置为DispatcherUnhandledExceptionFilterEventArgs该false事件,UnhandledException则不会引发该事件。

适用于

另请参阅