-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
61 lines (57 loc) · 1.7 KB
/
MainWindow.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
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
58
59
60
61
using System.Configuration;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Main_Project;
using Main_Project.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Question2;
namespace Question2
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public readonly FuminiHotelManagementContext context = FuminiHotelManagementContext.INSTANCE;
public Customer _customer { get; set; }
public bool isAdmin { get; set; }
public IConfigurationRoot configuration;
private static MainWindow _instance;
public static MainWindow INSTANCE
{
get
{
if (_instance == null)
{
_instance = new MainWindow();
}
return _instance;
}
}
private void LoadAppSettings()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
configuration = builder.Build();
}
public MainWindow()
{
LoadAppSettings();
_instance = this;
isAdmin = false;
InitializeComponent();
MainFrame.Navigate(new Page1());
}
}
}