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); }
protected void SetupSplitViewWindowRootNavigation(UIViewController viewController, MvxMasterDetailPresentationAttribute attribute) { if (attribute.WrapInNavigationController) { MasterNavigationController = CreateNavigationController(viewController); SetWindowRootViewController(MasterNavigationController); } else { SetWindowRootViewController(viewController); CloseMasterNavigationController(); } }
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)); }
protected virtual async Task <bool> CloseDetailSplitViewController(IMvxViewModel viewModel, MvxMasterDetailPresentationAttribute attribute) { if (SplitViewController != null && await CloseChildViewModel(viewModel).ConfigureAwait(false)) { return(true); } return(true); }
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); }
protected virtual bool CloseDetailSplitViewController(IMvxViewModel viewModel, MvxMasterDetailPresentationAttribute attribute) { if (SplitViewController != null && CloseChildViewModel(viewModel)) { return(true); } return(true); }