Exemplo n.º 1
0
        public async Task NavigateModalBack()
        {
            var dismissing = XamarinNavigator.NavigationStack.Last().BindingContext as IViewModelNavigationBase;

            await XamarinNavigator.PopModalAsync();

            dismissing?.AfterDismissed();
        }
Exemplo n.º 2
0
        public async Task NavigateModalTo(IViewModelNavigationBase viewModel)
        {
            var page = _viewLocator.CreateAndBindPageFor(viewModel);

            await viewModel.BeforeFirstShown();

            await XamarinNavigator.PushModalAsync(page);
        }
Exemplo n.º 3
0
        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();
            }
        }