Files
Chat/PrototypChat/App.xaml.cs

38 lines
952 B
C#
Raw Permalink Normal View History

using System;
using System.Threading.Tasks;
using System.Windows;
2023-03-03 21:23:48 +01:00
namespace ownChat
2017-09-12 14:32:34 +02:00
{
public partial class App
2017-09-12 14:32:34 +02:00
{
protected override void OnStartup(StartupEventArgs e)
2023-03-03 21:23:48 +01:00
{
base.OnStartup(e);
2023-03-03 21:23:48 +01:00
SetupExceptionHandling();
}
private void SetupExceptionHandling()
{
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
{
new ExceptionWindow((Exception) e.ExceptionObject) { Owner = MainWindow }.Show();
};
DispatcherUnhandledException += (s, e) =>
{
new ExceptionWindow(e.Exception) { Owner = MainWindow }.Show();
e.Handled = true;
};
TaskScheduler.UnobservedTaskException += (s, e) =>
{
new ExceptionWindow(e.Exception) { Owner = MainWindow }.Show();
e.SetObserved();
};
2023-03-03 21:23:48 +01:00
}
2017-09-12 14:32:34 +02:00
}
}