Exemple #1
0
 void NavigationService_NavigationHistoryCleared(object sender, NavigationHistoryClearedEventArgs e)
 {
     for (int i = 0; i < e.Count; i++)
     {
         UIViewController[] newControllers = new UIViewController[] { ViewControllers[ViewControllers.Length - 1] };
         SetViewControllers(newControllers, animated: false);
     }
 }
Exemple #2
0
            public async Task WhenSingleItemOnStack_NavigationHistoryClearedEventArgumentsAreCorrect()
            {
                NavigationHistoryClearedEventArgs args = null;

                target.NavigationHistoryCleared += (s, e) => args = e;
                // after running twice, navigation depth is 1
                for (int i = 0; i < 2; i++)
                {
                    await target.NavigateAsync(new TestViewModel(), waitFor : false, ct : CancellationToken.None);
                }

                target.ClearHistory();

                Assert.That(args.From, Is.Zero);
                Assert.That(args.Count, Is.EqualTo(1));
            }
Exemple #3
0
 void NavigationService_NavigationHistoryCleared(object sender, NavigationHistoryClearedEventArgs e)
 {
     ClearHistoryCommand.RaiseCanExecuteChanged();
     GoBackCommand.RaiseCanExecuteChanged();
 }