public SettingsPage() { InitializeComponent(); ViewModel.NavigationRequest += ViewModelOnNavigationRequest; SettingsNavFrame.Navigate(typeof(SettingsHomePage), null); ViewModelLocator.GeneralMain.CurrentOffStatus = $"Settings - {UWPUtilities.GetAppVersion()}"; }
private void ViewModelOnNavigationRequest(SettingsPageIndex page) { Type pageType; switch (page) { case SettingsPageIndex.General: pageType = typeof(SettingsGeneralPage); break; case SettingsPageIndex.Caching: pageType = typeof(SettingsCachingPage); break; case SettingsPageIndex.Calendar: pageType = typeof(SettingsCalendarPage); break; case SettingsPageIndex.Articles: pageType = typeof(SettingsArticlesPage); break; case SettingsPageIndex.News: pageType = typeof(SettingsNewsPage); break; case SettingsPageIndex.About: pageType = typeof(SettingsAboutPage); break; case SettingsPageIndex.LogIn: pageType = typeof(LogInPage); break; case SettingsPageIndex.Misc: pageType = typeof(SettingsMiscPage); break; case SettingsPageIndex.Homepage: pageType = typeof(SettingsHomePage); break; case SettingsPageIndex.Notifications: pageType = typeof(SettingsNotificationsPage); break; case SettingsPageIndex.Ads: pageType = typeof(SettingsAdsPage); break; case SettingsPageIndex.Feeds: pageType = typeof(SettingsFeedsPage); break; default: throw new ArgumentOutOfRangeException(nameof(page), page, null); } SettingsNavFrame.Navigate(pageType, null); }
public SettingsPage() { InitializeComponent(); Loaded += (sender, args) => ViewModelLocator.NavMgr.RegisterBackNav(PageIndex.PageAnimeList, null); ViewModel.NavigationRequest += ViewModelOnNavigationRequest; SettingsNavFrame.Navigate(typeof(SettingsHomePage), null); MobileViewModelLocator.Main.CurrentStatus = $"Settings - {UWPUtilities.GetAppVersion()}"; _initialized = true; }
private void NavigateTo(string pageTag) { string[] split = pageTag.Split('>'); SimplePanelDataContent dataContent = split[0] switch { "GENERAL" => NebulaClient.Settings.General, "SERVER" => NebulaClient.Settings.Server, "PROFILE" => NebulaClient.Settings.UserProfile, "APPEARANCE" => null, "PRIVACY" => null, _ => null }; if (dataContent != null) { SettingsNavFrame.Navigate(typeof(NebulaPage), dataContent, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }); } else { switch (split[0]) { case "APPEARANCE": SettingsNavFrame.Navigate(typeof(AppearancePage), new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }); break; case "PRIVACY": SettingsNavFrame.Navigate(typeof(PrivacyPage), new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }); break; case "ABOUT": SettingsNavFrame.Navigate(typeof(AboutPage), new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }); break; } } Header.Text = (MenuListView.SelectedItem as ListViewItem)?.Content.ToString(); }
private void ViewModelOnNavigationRequest(Type pageType) { SettingsNavFrame.Navigate(pageType, null); }