-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
30 lines (28 loc) · 915 Bytes
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Windows;
namespace BG3LocalizationMerger
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
DispatcherUnhandledException += OnDispatcherUnhandledException;
}
private void OnDispatcherUnhandledException(
object sender,
System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e
)
{
string errorMessage = string.Format(
"An unhandled exception occurred:\n\n{0}\n\nStackTrace:\n{1}",
e.Exception.Message,
e.Exception.StackTrace
);
MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
e.Handled = true;
}
}
}