/// <summary> /// Global handler for when a Navigation happens /// </summary> /// <param name="sender">The object causing the navigation</param> /// <param name="e">Arguments pased in as part of navigation</param> private void RootFrameNavigated(object sender, NavigationEventArgs e) { if (e.NavigationMode == NavigationMode.New && e.Uri.ToString().Contains("BackNavSkipOne=True")) { RootFrame.RemoveBackEntry(); } }
private void GoBack() { if (RootFrame.CanGoBack) { RootFrame.GoBack(); RootFrame.RemoveBackEntry(); } }
internal static void ClearBackHistory() { Logger.MethodCalled("App.ClearBackHistory()"); var backStackCount = RootFrame.BackStack.Count(); for (int i = 0; i < backStackCount; i++) { RootFrame.RemoveBackEntry(); } }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { RootFrame.Navigated -= ClearBackStackAfterReset; if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) { return; } while (RootFrame.RemoveBackEntry() != null) { ; } }
private void RootFrame_Navigated(object sender, NavigationEventArgs e) { if (_clearStack) { _clearStack = false; while (RootFrame.CanGoBack) { RootFrame.RemoveBackEntry(); } } ViewModelLocator.MainViewModel.UpdateCanGoBack(); }
//*********************************************************************************************************************** //*********************************************************************************************************************** /// <summary> /// Complète l'initialisation. /// </summary> /// <param name="Sender">Objet source de l'appel.</param> /// <param name="Args"> /// <b>NavigationEventArgs</b> qui contient les données d'événement. /// </param> //----------------------------------------------------------------------------------------------------------------------- private void ClearBackStackAfterReset(object Sender, NavigationEventArgs Args) { //------------------------------------------------------------------------------------------------------------------- Instance.RootFrame.Navigated -= this.ClearBackStackAfterReset; if (Args.NavigationMode != NavigationMode.New && Args.NavigationMode != NavigationMode.Refresh) { return; } while (RootFrame.RemoveBackEntry() != null) { } //------------------------------------------------------------------------------------------------------------------- }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { // Unregister the event so it doesn't get called again RootFrame.Navigated -= ClearBackStackAfterReset; // Only clear the stack for 'new' (forward) and 'refresh' navigations if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) return; // For UI consistency, clear the entire page stack while (RootFrame.RemoveBackEntry() != null) { ; // do nothing } }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { // 取消注册事件,以便不再调用该事件 RootFrame.Navigated -= ClearBackStackAfterReset; // 只为“新建”(向前)和“刷新”导航清除堆栈 if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) { return; } // 为了获得 UI 一致性,请清除整个页面堆栈 while (RootFrame.RemoveBackEntry() != null) { ; // 不执行任何操作 } }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { // Désinscrire l'événement pour qu'il ne soit plus appelé RootFrame.Navigated -= ClearBackStackAfterReset; // Effacer uniquement la pile des « nouvelles » navigations (avant) et des actualisations if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) { return; } // Pour une interface utilisateur cohérente, effacez toute la pile de la page while (RootFrame.RemoveBackEntry() != null) { ; // ne rien faire } }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { // Отменить регистрацию события, чтобы оно больше не вызывалось RootFrame.Navigated -= ClearBackStackAfterReset; // Очистка стека только для "новых" навигаций (вперед) и навигаций "обновления" if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) { return; } // Очистка всего стека страницы для согласованности пользовательского интерфейса while (RootFrame.RemoveBackEntry() != null) { ; // ничего не делать } }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { // 移除註冊事件,使它不會再次被呼叫 RootFrame.Navigated -= ClearBackStackAfterReset; // 只清除 '新' (下一頁) 和 '重新整理' 巡覽的堆疊 if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) { return; } // 為了 UI 的一致性,清除整個頁面堆疊 while (RootFrame.RemoveBackEntry() != null) { ; // 不執行任何動作 } }
public void cancelNavigate() { RootFrame.RemoveBackEntry(); // Refresh the history list since the back stack has been modified. }
private void ClearAllBackStack() { while (RootFrame.RemoveBackEntry() != null) { } }
public void RemoveBackEntry() { RootFrame.RemoveBackEntry(); }