Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public virtual void NativeModalViewControllerDisappearedOnItsOwn()
 {
     CloseModalViewController(ModalViewControllers.Last());
 }
Exemplo n.º 3
0
 public override void NativeModalViewControllerDisappearedOnItsOwn()
 {
     CloseModalViewController(ModalViewControllers.Last());
 }
Exemplo n.º 4
0
 public virtual ValueTask <bool> CloseTopModalViewController()
 {
     return(CloseModalViewController(ModalViewControllers?.Last()));
 }
Exemplo n.º 5
0
 public virtual void CloseTopModalViewController()
 {
     CloseModalViewController(ModalViewControllers?.Last());
 }