Exemplo n.º 1
0
        protected virtual async Task <bool> ShowMasterDetailSplitViewController(
            UIViewController viewController,
            MvxMasterDetailPresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            if (SplitViewController != null && attribute.Position == MasterDetailPosition.Master)
            {
                return(await ShowMasterView(viewController, attribute.WrapInNavigationController));
            }
            else if (SplitViewController != null && attribute.Position == MasterDetailPosition.Detail)
            {
                return(await ShowDetailView(viewController, attribute.WrapInNavigationController));
            }
            else if (viewController is MvxSplitViewController && attribute.Position == MasterDetailPosition.Root)
            {
                SplitViewController = (MvxSplitViewController)viewController;

                // set root
                await SetupSplitViewWindowRootNavigation(viewController, attribute);

                await CloseModalViewControllers();
                await CloseTabBarViewController();
            }
            else
            {
                throw new MvxException("Trying to show a master page without a SplitViewController, this is not possible!");
            }
            return(true);
        }
Exemplo n.º 2
0
 protected void SetupSplitViewWindowRootNavigation(UIViewController viewController,
                                                   MvxMasterDetailPresentationAttribute attribute)
 {
     if (attribute.WrapInNavigationController)
     {
         MasterNavigationController = CreateNavigationController(viewController);
         SetWindowRootViewController(MasterNavigationController);
     }
     else
     {
         SetWindowRootViewController(viewController);
         CloseMasterNavigationController();
     }
 }
Exemplo n.º 3
0
 protected ValueTask <bool> SetupSplitViewWindowRootNavigation(UIViewController viewController,
                                                               MvxMasterDetailPresentationAttribute attribute)
 {
     if (attribute.WrapInNavigationController)
     {
         MasterNavigationController = CreateNavigationController(viewController);
         SetWindowRootViewController(MasterNavigationController);
     }
     else
     {
         SetWindowRootViewController(viewController);
         return(CloseMasterNavigationController());
     }
     return(new ValueTask <bool>(true));
 }
Exemplo n.º 4
0
 protected virtual async Task <bool> CloseDetailSplitViewController(IMvxViewModel viewModel, MvxMasterDetailPresentationAttribute attribute)
 {
     if (SplitViewController != null && await CloseChildViewModel(viewModel).ConfigureAwait(false))
     {
         return(true);
     }
     return(true);
 }
Exemplo n.º 5
0
 protected virtual async Task <bool> CloseMasterSplitViewController(IMvxViewModel viewModel, MvxMasterDetailPresentationAttribute attribute)
 {
     if (SplitViewController != null &&
         attribute.Position != MasterDetailPosition.Root &&
         await CloseChildViewModel(viewModel))
     {
         return(true);
     }
     else if (attribute.Position == MasterDetailPosition.Root)
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 6
0
 protected virtual bool CloseDetailSplitViewController(IMvxViewModel viewModel, MvxMasterDetailPresentationAttribute attribute)
 {
     if (SplitViewController != null && CloseChildViewModel(viewModel))
     {
         return(true);
     }
     return(true);
 }