first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

WPF: WPF DispatcherUnhandledException Pattern

/// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e);

    this.DispatcherUnhandledException +=
         new DispatcherUnhandledExceptionEventHandler(
             (s, args) =&gt;
             {
                 MessageBox.Show(string.Format(&quot;An error occured: {0}&quot;, 
                 args.Exception.Message), &quot;Error&quot;);
                 args.Handled = true;
             });
}

}

mod date: 2010-02-24T00:35:48.000Z