forked from arsentuf-protag/SUBSTitute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
26 lines (25 loc) · 1011 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
using Sungaila.SUBSTitute.ViewModels;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace Sungaila.SUBSTitute
{
public partial class App : Application
{
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
if (MessageBox.Show(MainWindow,
$"The following unexpected error has occured:{Environment.NewLine}{Environment.NewLine}{e.Exception.Message}{Environment.NewLine}{Environment.NewLine}[OK] will terminate this application.{Environment.NewLine}[Cancel] will keep the application running but it might be unstable from now on.",
"Unexpected error",
MessageBoxButton.OKCancel,
MessageBoxImage.Error) != MessageBoxResult.OK)
e.Handled = true;
}
}
}