public ShellViewModel() { MainViewModel = new MainPageViewModel(); PdfViewModel = new PdfViewModel(); SettingsViewModel = new SettingsPageViewModel(); Menu.Add(new MenuItem { Glyph = "", Text = "Library", NavigationDestination = typeof (MainPage), ViewModel = MainViewModel }); Menu.Add(new MenuItem { Glyph = "", Text = "Viewer", NavigationDestination = typeof (PdfPage), ViewModel = PdfViewModel }); Menu.Add(new MenuItem { Glyph = "", Text = "Settings", NavigationDestination = typeof (SettingsPage), ViewModel = SettingsViewModel }); }
public ShellViewModel() { MainViewModel = new MainPageViewModel(); PdfViewModel = new PdfViewModel(); SettingsViewModel = new SettingsPageViewModel(); Menu.Add(new MenuItem { Glyph = "", Text = "Library", NavigationDestination = typeof(MainPage), ViewModel = MainViewModel }); Menu.Add(new MenuItem { Glyph = "", Text = "Viewer", NavigationDestination = typeof(PdfPage), ViewModel = PdfViewModel }); Menu.Add(new MenuItem { Glyph = "", Text = "Settings", NavigationDestination = typeof(SettingsPage), ViewModel = SettingsViewModel }); }
public SettingsPage() { InitializeComponent(); if (DataContext == null) { DataContext = new SettingsPageViewModel(); } _viewmodel = DataContext as SettingsPageViewModel; }