-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathApp.xaml.cs
More file actions
28 lines (23 loc) · 1021 Bytes
/
Copy pathApp.xaml.cs
File metadata and controls
28 lines (23 loc) · 1021 Bytes
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
using System.Windows;
using Egor92.MvvmNavigation;
using RestaurantApp.Constants;
using RestaurantApp.Infrastructure.Implementations;
using RestaurantApp.ViewModels;
using RestaurantApp.Views;
namespace RestaurantApp
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
var window = new MainWindow();
var navigationManager = new NavigationManager(window.FrameContent);
var dialogManager = new DialogManager();
var viewModel = new MainWindowViewModel(navigationManager);
window.DataContext = viewModel;
navigationManager.Register<FoodSelectionView>(NavigationKeys.FoodSelection, () => new FoodSelectionViewModel(navigationManager, dialogManager));
navigationManager.Register<FoodCookingView>(NavigationKeys.FoodCooking, () => new FoodCookingViewModel(navigationManager, dialogManager));
window.Show();
}
}
}