Weiß nicht mehr, was ich geändert habe

This commit is contained in:
2024-11-12 19:24:35 +01:00
parent 02e4f31e85
commit 4222b41ece
6 changed files with 203 additions and 58 deletions

View File

@@ -2,7 +2,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ownChat"
DispatcherUnhandledException="App_DispatcherUnhandledException"
StartupUri="LoginMaske.xaml">
<Application.Resources>

View File

@@ -1,14 +1,37 @@
using System.Windows.Threading;
using System;
using System.Threading.Tasks;
using System.Windows;
namespace ownChat
{
public partial class App
{
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args)
protected override void OnStartup(StartupEventArgs e)
{
new ExceptionWindow(args.Exception) { Owner = MainWindow }.Show();
base.OnStartup(e);
args.Handled = true;
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();
};
}
}
}

View File

@@ -13,6 +13,7 @@ namespace ownChat
{
private readonly ChatEmojisView _EmojiView;
public MainWindow(ChatDatenUebergabe x)
{
InitializeComponent();