Exemplo n.º 1
0
        private async Task <bool> ShowPopupPage(Type view, MvxPopupPagePresentationAttribute attribute, MvxViewModelRequest request)
        {
            var page = CreatePage(view, request, attribute) as PopupPage;

            await FormsApplication.MainPage.Navigation.PushPopupAsync(page, attribute.Animated);

            return(true);
        }
Exemplo n.º 2
0
        private async Task <bool> ClosePopupPage(IMvxViewModel viewModel, MvxPopupPagePresentationAttribute attribute)
        {
            var popup = PopupNavigation.Instance.PopupStack?.OfType <IMvxPage>()
                        .FirstOrDefault(x => x.ViewModel == viewModel);

            if (!(popup is PopupPage page))
            {
                await FormsApplication.MainPage.Navigation.PopPopupAsync(attribute.Animated);

                return(true);
            }

            await FormsApplication.MainPage.Navigation.RemovePopupPageAsync(page, attribute.Animated);

            return(true);
        }