Ejemplo n.º 1
0
        public override void Show(MvxViewModelRequest request)
        {
            if (request.PresentationValues != null)
            {
                if (request.PresentationValues.ContainsKey(PresentationBundleFlagKeys.ClearStack))
                {
                    foreach (var vc in MasterNavigationController.ViewControllers)
                    {
                        vc.DismissViewController(true, null);
                    }

                    var nextViewController = this.CreateViewControllerFor(request) as UIViewController;

                    if (MasterNavigationController.TopViewController.GetType() != nextViewController.GetType())
                    {
                        MasterNavigationController.PopToRootViewController(false);
                        MasterNavigationController.PushViewController(nextViewController, false);
                    }

                    return;
                }

                if (request.PresentationValues.ContainsKey(PresentationBundleFlagKeys.NoAnimation))
                {
                    var nextViewController = this.CreateViewControllerFor(request) as UIViewController;
                    MasterNavigationController.PushViewController(nextViewController, false);


                    return;
                }

                if (request.PresentationValues.ContainsKey(PresentationBundleFlagKeys.TransitionLeftToRight))
                {
                    var nextViewController = this.CreateViewControllerFor(request) as UIViewController;
                    MasterNavigationController.PushControllerWithTransition(nextViewController, UIViewAnimationOptions.TransitionCurlDown);


                    return;
                }
            }
            base.Show(request);
        }