public void GoBack() { if (PageKeyHistorique.Count() > 0) { string pageKeyOld = PageKeyHistorique.Pop(); Frame frameToGoBack = GetFrame(CurrentPageKey); CurrentPageKey = pageKeyOld; if (frameToGoBack.CanGoBack) { frameToGoBack.GoBack(); } SetAppBarBackButtonVisibility(); } }
private void SetMainPage(string pageKey) { int oldRootType = (PageKeyHistorique.Count() > 0) ? this.ConfigurationRootLevel[PageKeyHistorique.Peek()] : -1; if (oldRootType != 2 && oldRootType != 3) { if (MainPage == null) { MainPage = new MainPage(); } RootFrame.Navigate(MainPage.GetType()); CurrentFrame = ((Window.Current.Content as Frame).Content as MainPage).AppFrame; } }
private void InitNavigation(string pageKey) { if (CurrentPageKey != null) { PageKeyHistorique.Push(CurrentPageKey); } CurrentPageKey = pageKey; switch (this.ConfigurationRootLevel[pageKey]) { case 0: PageKeyHistorique.Clear(); break; case 2: PageKeyHistorique.Clear(); SetMainPage(pageKey); break; case 3: SetMainPage(pageKey); break; } }
private void SetAppBarBackButtonVisibility() { bool canGoBack = PageKeyHistorique.Count() > 0; SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = (canGoBack) ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed; }