public async Task NavigateModalBack() { var dismissing = XamarinNavigator.NavigationStack.Last().BindingContext as IViewModelNavigationBase; await XamarinNavigator.PopModalAsync(); dismissing?.AfterDismissed(); }
public async Task NavigateModalTo(IViewModelNavigationBase viewModel) { var page = _viewLocator.CreateAndBindPageFor(viewModel); await viewModel.BeforeFirstShown(); await XamarinNavigator.PushModalAsync(page); }
public async Task NavigateBackToRoot() { var toDismiss = XamarinNavigator.NavigationStack.Skip(1).Select(vw => vw.BindingContext).OfType <IViewModelNavigationBase>().ToArray(); await XamarinNavigator.PopToRootAsync(); foreach (var viewModel in toDismiss) { _ = viewModel.AfterDismissed(); } }