Dispatcher.UnhandledException 事件

定義

發生於當擲回執行緒例外狀況且透過 InvokeBeginInvoke 執行委派期間無法攔截時。

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 

事件類型

備註

當透過 或 BeginInvoke 未攔截委派執行 Invoke 期間擲回的例外狀況時,就會引發此事件。

處理常式可以將例外狀況標示為已處理,這可防止呼叫內部例外狀況處理常式。

必須小心撰寫此事件的事件處理常式,以避免建立次要例外狀況,並攔截任何發生的情況。 建議您避免在處理常式中配置記憶體或執行任何耗用大量資源的作業。

事件 UnhandledExceptionFilter 提供一種方法來不引發 UnhandledException 事件。 事件 UnhandledExceptionFilter 會先引發,如果 RequestCatch 上的 DispatcherUnhandledExceptionFilterEventArgs 設定為 falseUnhandledException 則不會引發事件。

適用於

另請參閱