Ejemplo n.º 1
0
        protected override void ShowView(IModalView view, bool isDialog, IDataContext context)
        {
            var parentController = (UIViewController)ViewModel
                                   .GetIocContainer(true)
                                   .Get <INavigationService>()
                                   .CurrentContent;
            var  toShow = view.GetUnderlyingView <UIViewController>();
            bool animated;

            if (context.TryGetData(NavigationConstants.UseAnimations, out animated))
            {
                ViewModel.Settings.State.AddOrUpdate(NavigationConstants.UseAnimations, animated);
            }
            else
            {
                animated = UseAnimations;
            }
            if (view is IModalNavSupportView)
            {
                var nav = new MvvmNavigationController();
                nav.PushViewController(toShow, animated);
                toShow = nav;
                BindProvider(nav);
            }
            parentController.PresentViewController(toShow, animated, NodoAction);
            toShow.TryRaiseAttachedEvent(AttachedMembers.Object.Parent);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Shows the view in the specified mode.
        /// </summary>
        protected override void ShowView(IModalView view, bool isDialog, IDataContext context)
        {
            var parentController = (UIViewController)ViewModel
                                   .GetIocContainer(true)
                                   .Get <INavigationService>()
                                   .CurrentContent;
            UIViewController toShow;

            if (view is IModalNavSupportView)
            {
                var nav = new MvvmNavigationController();
                nav.PushViewController((UIViewController)view, UseAnimations);
                toShow = nav;
                BindProvider(nav);
            }
            else
            {
                toShow = (UIViewController)view;
            }
            parentController.PresentViewController(toShow, UseAnimations, NodoAction);
            BindingExtensions.AttachedParentMember.Raise(toShow, EventArgs.Empty);
        }