protected virtual bool CloseModalViewController(IMvxViewModel toClose) { // check if there is a modal stack presented if (ModalViewControllers.LastOrDefault() is UINavigationController modalNavController) { if (TryCloseViewControllerInsideStack(modalNavController, toClose)) { // First() is the RootViewController of the stack. If it is being closed, then remove the nav stack if (modalNavController.ViewControllers.First().GetIMvxIosView().ViewModel == toClose) { CloseModalViewController(modalNavController); } return(true); } } else { // close any plain modal presented var last = ModalViewControllers.Last(); if (last.GetIMvxIosView().ViewModel == toClose) { CloseModalViewController(last); return(true); } } return(false); }
public virtual void NativeModalViewControllerDisappearedOnItsOwn() { CloseModalViewController(ModalViewControllers.Last()); }
public override void NativeModalViewControllerDisappearedOnItsOwn() { CloseModalViewController(ModalViewControllers.Last()); }
public virtual ValueTask <bool> CloseTopModalViewController() { return(CloseModalViewController(ModalViewControllers?.Last())); }
public virtual void CloseTopModalViewController() { CloseModalViewController(ModalViewControllers?.Last()); }