Weiß nicht mehr, was ich geändert habe
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace ownChat
|
||||
{
|
||||
private readonly ChatEmojisView _EmojiView;
|
||||
|
||||
|
||||
public MainWindow(ChatDatenUebergabe x)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Reference in New Issue
Block a user