public void RemoveLastPage() { if (ChildPage.BackStackDepth > 1) { ChildPage.BackStack.RemoveAt(ChildPage.BackStackDepth - 1); } if (!CanGoBack) { EnableBackButton?.Invoke(null, Visibility.Collapsed); } }
public void ClearHistory() { if (IsHomePage) { // assume current page is HomePage ChildPage.BackStack.Clear(); } else { // assume current page is not HomePage RootFrame.BackStack.Clear(); } EnableBackButton?.Invoke(null, Visibility.Collapsed); }
public void Navigate(Type type, object parameter, NavigationTransitionInfo navigationtransition = null) { if (IsHomePage) { ChildPage.Navigate(type, parameter, navigationtransition); } else { // assume current page is not HomePage RootFrame.Navigate(type, parameter, navigationtransition); } if (CanGoBack) { EnableBackButton?.Invoke(null, Visibility.Visible); } }
public void GoBack() { if (IsHomePage) { if (CanGoBack) { ChildPage.GoBack(); } } else { if (RootFrame.CanGoBack) { RootFrame.GoBack(); } } if (!CanGoBack) { EnableBackButton?.Invoke(null, Visibility.Collapsed); } }