/// <summary> /// Initializes the automatic error reporting for Wpf applications. /// </summary> /// <param name="app">The main application object.</param> /// <param name="mainWindow">The window that acts as the host of the error dialog.</param> public void InitializeAutoErrorReporting_Wpf(System.Windows.Application app, System.Windows.Window mainWindow) { app.EnsureNotNull(nameof(app)); app.DispatcherUnhandledException += (sender, eArgs) => { ExceptionInfo exInfo = new ExceptionInfo(eArgs.Exception); eArgs.Handled = true; SeeingSharpWpfErrorDialog.ShowDialog(mainWindow, exInfo); }; }