public virtual void ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            CloseAllModals();

            var page = CreatePage(view, request, attribute);

            if (attribute.WrapInNavigationPage && FormsApplication.MainPage is MvxNavigationPage navigationPage)
            {
                if (attribute.NoHistory)
                {
                    navigationPage.PopToRootAsync(attribute.Animated);
                }
                navigationPage.PushAsync(page, attribute.Animated);
            }
            else if (attribute.WrapInNavigationPage)
            {
                FormsApplication.MainPage = new MvxNavigationPage(page);
            }
            else
            {
                FormsApplication.MainPage = page;
            }
        }
 public override Task <bool> CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     if ((FormsApplication.MainPage as TabbedPage)?.CurrentPage is NavigationPage root)
     {
         return(FindAndCloseViewFromViewModel(viewModel, root, attribute));
     }
     return(base.CloseContentPage(viewModel, attribute));
 }
Beispiel #3
0
 public virtual bool CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     if (FormsApplication.MainPage is MvxNavigationPage navigationPage)
     {
         navigationPage.PopAsync(attribute.Animated);
     }
     return(true);
 }
Beispiel #4
0
        public virtual void ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var page = CloseAndCreatePage(view, request, attribute);

            PushOrReplacePage(FormsApplication.MainPage, page, attribute);
        }
Beispiel #5
0
        public virtual async Task <bool> ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var page = await CloseAndCreatePage(view, request, attribute);

            await PushOrReplacePage(FormsApplication.MainPage, page, attribute);

            return(true);
        }
Beispiel #6
0
        public virtual void ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            CloseAllModals();
            ClosePlatformViews?.Invoke();

            var page = CreatePage(view, request, attribute);

            PushOrReplacePage(FormsApplication.MainPage, page, attribute);
        }
Beispiel #7
0
        public virtual void ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var page = CreatePage(view, request);

            //TODO: Check ModalStack and push there if applied

            if (attribute.WrapInNavigationPage && (FormsApplication.MainPage == null || FormsApplication.MainPage.GetType() != typeof(MvxNavigationPage)))
            {
                FormsApplication.MainPage = new MvxNavigationPage(page);
            }
            else if (attribute.WrapInNavigationPage && FormsApplication.MainPage is MvxNavigationPage navigationPage)
            {
                navigationPage.PushAsync(page, attribute.Animated);
            }
            else
            {
                //TODO: Crashes on iOS
                FormsApplication.MainPage = page;
            }
        }
Beispiel #8
0
 public virtual bool CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     return(ClosePage(FormsApplication.MainPage, null, attribute));
 }
Beispiel #9
0
 public virtual Task <bool> CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     return(FindAndCloseViewFromViewModel(viewModel, FormsApplication.MainPage, attribute));
 }