2010-02-12 8 views

답변

13

당신은 사용할 수 있습니다 DispatcherUnhandledException :

XAML (App.xaml) : 코드 뒤에 (App.xaml.cs를/VB

<Application x:Class="App.App" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    StartupUri="wndMain.xaml" DispatcherUnhandledException="Application_DispatcherUnhandledException"> 

:.

private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 
{ 
    // Handle error here 

    ... 

    // Prevent default unhandled exception processing by WPF 
    e.Handled = true; 
} 

more here 최대 읽기 항상 그러나 처음부터 정확한 양의 오류 처리를 수행하십시오.이 방법으로 오류를 전달하지 마십시오.

관련 문제