using System.Windows.Threading; namespace ownChat { public partial class App { private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args) { new ExceptionWindow(args.Exception) { Owner = MainWindow }.Show(); args.Handled = true; } } }