public override void Close(Cirrious.MvvmCross.ViewModels.IMvxViewModel toClose)
 {
     for (int i = _viewPresenters.Count - 1; i >= 0; i--)
     {
         if (_viewPresenters[i].ViewModel == toClose)
         {
             CloseViewController(_viewPresenters[i]);
             break;
         }
     }
 }
Example #2
0
        public override void Close(Cirrious.MvvmCross.ViewModels.IMvxViewModel viewModel)
        {
            this.ViewModels.Remove(viewModel);
            var lastViewModel = this.ViewModels.LastOrDefault() as IHandlesResult;

            if (lastViewModel != null)
            {
                lastViewModel.HandlesResult(viewModel);
            }

            base.Close(viewModel);
        }
Example #3
0
        public override void Close(Cirrious.MvvmCross.ViewModels.IMvxViewModel toClose)
        {
            var lastView = this.MasterNavigationController.ViewControllers.ToList().Where(x => x != this.MasterNavigationController.VisibleViewController).LastOrDefault();

            if (lastView != null)
            {
                var lastViewController = lastView as MvxViewController;
                if (lastViewController != null)
                {
                    var lastViewModel = lastViewController.ViewModel as IHandlesResult;

                    if (lastViewModel != null)
                    {
                        lastViewModel.HandlesResult(toClose);
                    }
                }
            }

            base.Close(toClose);
        }