-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
59 lines (49 loc) · 1.58 KB
/
Copy pathMainWindow.xaml.cs
File metadata and controls
59 lines (49 loc) · 1.58 KB
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
using WPF = System.Windows;
using TachyDev.View;
using TachyDev.ViewModel;
namespace TachyDev;
public partial class MainWindow : WPF.Window
{
public MainWindow()
{
InitializeComponent();
var navVM = (NavigationVM)this.Nav.DataContext;
navVM.PropertyChanged += NavVM_PropertyChanged;
}
private void NavVM_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender is not NavigationVM navVM) return;
if (navVM.SelectedPageName is not string selectedPageName) return;
WPF.Controls.Page? activePage = null;
switch (selectedPageName)
{
case "AUTHORIZE":
activePage = new AuthView();
break;
case "RESERVATIONS":
activePage = new ReservationsPage();
break;
case "ARRIVALS":
activePage = new ArrivalsPage();
break;
case "DEPARTURES":
activePage = new DeparturesPage();
break;
case "GUESTS":
activePage = new GuestsPage();
break;
case "ROOMS":
activePage = new RoomsPage();
break;
case "STATISTICS":
activePage = new StatisticsPage();
break;
default:
break;
};
if (activePage == null) return;
this.NavFrame.Navigate(activePage);
this.TitleLabel.Content = activePage.Title;
//MessageBox.Show(active_page);
}
}