コード例 #1
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            var closeHint = hint as MvxClosePresentationHint;
            if (closeHint != null)
            {
                if (_currentModal != null)
                {
                    ((UIViewController)_currentModal).DismissViewController(true, null);
                    return;
                }

                for (int i = _generalNavigationController.ViewControllers.Length - 1; i >= 1; i--)
                {
                    var vc = _generalNavigationController.ViewControllers[i];
                    var touchView = vc as IMvxTouchView;
                    if (touchView != null && touchView.ViewModel == closeHint.ViewModelToClose)
                    {
                        _generalNavigationController.PopToViewController(_generalNavigationController.ViewControllers[i - 1], true);
                        return;
                    }
                }

                //If it didnt trigger above it's because it was probably the root.
                _generalNavigationController.PopToRootViewController(true);
            }
        }
コード例 #2
0
        public bool ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint)
                CloseRequests.Add((MvxClosePresentationHint)hint);

            return true;
        }
コード例 #3
0
 public async void ChangePresentation(MvxPresentationHint hint)
 {
     if (hint is MvxClosePresentationHint)
     {
         // TODO - perhaps we should do more here... also async void is a boo boo
         await _navigationPage.PopAsync();
     }
 }
コード例 #4
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            ProcessActivePanelPresentation(hint);
            ProcessResetRootPresentation(hint);
            ProcessPopToRootPresentation(hint);

            base.ChangePresentation(hint);
        }
コード例 #5
0
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     Action action = () =>
                         {
                             MvxTrace.TaggedTrace("MacNavigation", "Change presentation requested");
                             _presenter.ChangePresentation(hint);
                         };
     return RequestMainThreadAction(action);
 }
コード例 #6
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint)
            {
                return;
            }

            base.ChangePresentation(hint);
        }
コード例 #7
0
        public override void ChangePresentation(Cirrious.MvvmCross.ViewModels.MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint &&
                _window.RootViewController.ModalViewController is NewAppointmentView)
            {
                this.CloseModalViewController();
            }

            base.ChangePresentation(hint);
        }
コード例 #8
0
        public virtual void ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint)
            {
                Close((hint as MvxClosePresentationHint).ViewModelToClose);
                return;
            }

            MvxTrace.Warning("Hint ignored {0}", hint.GetType().Name);
        }
コード例 #9
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint)
            {
                Close((hint as MvxClosePresentationHint).ViewModelToClose);
                return;
            }

            base.ChangePresentation(hint);
        }
コード例 #10
0
 // TODO: There is no CLOSE Method for a view - any view changes come down as presentation hints
 public override void ChangePresentation(MvxPresentationHint hint)
 {
     if (hint is LogoutPresentationHint)
     {
         var service = Mvx.Resolve<IPropertyTrackerService>(); 
         service.Logout();
         
         CloseUpTo(_loginViewController);
         return;
     }
     base.ChangePresentation(hint);
 }
コード例 #11
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            if (HandlePresentationChange(hint)) return;

            if (hint is MvxClosePresentationHint)
            {
                Close((hint as MvxClosePresentationHint).ViewModelToClose);
                return;
            }

            MvxTrace.Warning("Hint ignored {0}", hint.GetType().Name);
        }
コード例 #12
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint) {
                var viewModel = (hint as MvxClosePresentationHint).ViewModelToClose;

                Activity activity = this.Activity;

                IMvxView mvxView = activity as IMvxView;

                activity.Finish ();

                return;
            }
        }
コード例 #13
0
 public virtual void ChangePresentation(MvxPresentationHint hint)
 {
     if (hint is MvxClosePresentationHint)
     {
         var finder = Mvx.Resolve<IMvxControlFinder>();
         var control = finder.GetControl((hint as MvxClosePresentationHint).ViewModelToClose);
         if (control != null)
             control.ViewModel = null;
         else
             _viewPresenter.ChangePresentation(hint);
     }
     else
         _viewPresenter.ChangePresentation(hint);
 }
コード例 #14
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            var closeHint = hint as MvxClosePresentationHint;

            if (closeHint != null &&
                closeHint.ViewModelToClose.GetType() == typeof(SettingsViewModel))
            {
                SettingsView.Current.Finish();

            }
            else
            {
                base.ChangePresentation(hint);
            }
        }
コード例 #15
0
        public virtual async void ChangePresentation(MvxPresentationHint hint)
        {
            if (hint is MvxClosePresentationHint)
            {
                var mainPage = _mvxFormsApp.MainPage as NavigationPage;

                if (mainPage == null)
                {
                    Mvx.TaggedTrace("MvxFormsPresenter:ChangePresentation()", "Shit, son! Don't know what to do");
                }
                else
                {
                    // TODO - perhaps we should do more here... also async void is a boo boo
                    await mainPage.PopAsync();
                }
            }
        }
コード例 #16
0
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     throw new NotImplementedException();
 }
コード例 #17
0
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     var navigation = Mvx.Resolve<IMvxConsoleNavigation>();
     return RequestMainThreadAction(() => navigation.ChangePresentation(hint));
 }
コード例 #18
0
        private void ProcessActivePanelPresentation(MvxPresentationHint hint)
        {
            var activePresentationHint = hint as ActivePanelPresentationHint;
            if (activePresentationHint != null)
            {
                var panelHint = activePresentationHint;

                _activePanel = panelHint.ActivePanel;

                if (panelHint.ShowPanel)
                {
                    ShowPanel(panelHint.ActivePanel);
                }
            }
        }
コード例 #19
0
 /// <summary>
 /// Changes the presentation.
 /// </summary>
 /// <param name="hint">The hint.</param>
 /// <returns>an exception.</returns>
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     Hints.Add(hint);
     return true;
 }
 public override void ChangePresentation(MvxPresentationHint hint)
 {
     _navigationStack.Pop();
     var request = _navigationStack.Pop();
     this.Show (request);
 }
コード例 #21
0
 public override void ChangePresentation(MvxPresentationHint hint)
 {
     base.ChangePresentation (hint);
 }
コード例 #22
0
        private void ProcessPopToRootPresentation(MvxPresentationHint hint)
        {
            var popHint = hint as PanelPopToRootPresentationHint;
            if (popHint != null)
            {
                var panelHint = popHint;

                switch (panelHint.Panel)
                {
                    case PanelEnum.Center:
                        if (CentrePanelUiNavigationController() != null)
                            CentrePanelUiNavigationController().PopToRootViewController(false);
                        break;
                    case PanelEnum.Left:
                        if (LeftPanelUiNavigationController() != null)
                            LeftPanelUiNavigationController().PopToRootViewController(false);
                        break;
                    case PanelEnum.Right:
                        if (RightPanelUiNavigationController() != null)
                            RightPanelUiNavigationController().PopToRootViewController(false);
                        break;
                }
            }
        }
コード例 #23
0
        private void ProcessResetRootPresentation(MvxPresentationHint hint)
        {
            var popHint = hint as PanelResetRootPresentationHint;
            if (popHint != null)
            {
                var panelHint = popHint;

                switch (panelHint.Panel)
                {
                    case PanelEnum.Center:
                        _jaSidePanelController.CenterPanel = null;
                        break;
                    case PanelEnum.Left:
                        _jaSidePanelController.LeftPanel = null;
                        break;
                    case PanelEnum.Right:
                        _jaSidePanelController.RightPanel = null;
                        break;
                }
            }
        }
コード例 #24
0
 public override void ChangePresentation(Cirrious.MvvmCross.ViewModels.MvxPresentationHint hint)
 {
     base.ChangePresentation(hint);
 }
コード例 #25
0
 public override void ChangePresentation(MvxPresentationHint hint)
 {
     this.MasterNavigationController.PopViewController (true);
 }
コード例 #26
0
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     CloseRequests.Add(null);
     return true;
 }
コード例 #27
0
        public override void ChangePresentation(MvxPresentationHint hint)
        {
            if (HandlePresentationChange(hint)) return;

            MvxTrace.Warning("Hint ignored {0}", hint.GetType().Name);
        }
コード例 #28
0
 public override void ChangePresentation(MvxPresentationHint hint)
 {
     MvxTrace.Warning("Hint ignored {0}", hint.GetType().Name);
 }
コード例 #29
0
 public bool ChangePresentation(MvxPresentationHint hint)
 {
     return RequestMainThreadAction(() => _presenter.ChangePresentation(hint));
 }