/// <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) =>
{
MessageBox.Show(string.Format("An error occured: {0}",
args.Exception.Message), "Error");
args.Handled = true;
});
}
}