-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindowManager.cs
57 lines (47 loc) · 1.26 KB
/
WindowManager.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Windows.Controls;
using PAYMAP_BACKEND.Views;
using MahApps.Metro.Controls;
namespace PAYMAP_BACKEND
{
public partial class WindowManager
{
private static WindowManager _instance;
public static bool IsModuleRunning = false;
public static bool IsModuleHealthy = false;
private WindowManager()
{
}
public static WindowManager GetInstance()
{
return _instance ?? (_instance = new WindowManager());
}
public static void ShowMainWindow()
{
if (_mainWindow == null)
{
_mainWindow = new MainWindow();
}
_mainWindow.Show();
}
public static void HideMainWindow()
{
try
{
_mainWindow?.Close();
}
catch (Exception exception)
{
LogManager.NewLog(LogType.WindowManager, LogLevel.Error, "HideMainWindow", exception);
}
}
public static void OnMainWindowLoaded()
{
InitializeMainWindow();
}
public static void OnMainWindowClosed()
{
App.OnUserTerminate();
}
}
}