/// <summary>
 /// Removes the most recent available entry from the back stack.
 /// </summary>
 public void RemoveBackEntry()
 {
     if (EnsureNavigationService() && _navigationService.CanGoBack)
     {
         _navigationService.RemoveBackEntry();
     }
 }
 public void ClearAllBackEntries()
 {
     System.Windows.Navigation.NavigationService navigationService = frame.NavigationService;
     while (navigationService.CanGoBack)
     {
         navigationService.RemoveBackEntry();
     }
 }