Esempio n. 1
0
        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));
 }
Esempio n. 3
0
 public virtual bool CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     if (FormsApplication.MainPage is MvxNavigationPage navigationPage)
     {
         navigationPage.PopAsync(attribute.Animated);
     }
     return(true);
 }
Esempio n. 4
0
        public virtual void ShowContentPage(
            Type view,
            MvxContentPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var page = CloseAndCreatePage(view, request, attribute);

            PushOrReplacePage(FormsApplication.MainPage, page, attribute);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 8
0
 public virtual bool CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     return(ClosePage(FormsApplication.MainPage, null, attribute));
 }
Esempio n. 9
0
 public virtual Task <bool> CloseContentPage(IMvxViewModel viewModel, MvxContentPagePresentationAttribute attribute)
 {
     return(FindAndCloseViewFromViewModel(viewModel, FormsApplication.MainPage, attribute));
 }