示例#1
0
        private void NavigateTo(NavigationState nextState, NavigationEvent evt)
        {
            if (_currentState == nextState)
            {
                return;
            }

            var currentPresenter = _currentState?.GetPresenter();
            var nextPresenter    = nextState?.GetPresenter();

            _currentState = null;

            if (nextPresenter != null)
            {
                _currentState           = nextState;
                nextPresenter.Navigator = this;
                nextPresenter.Display(evt);
            }

            if (currentPresenter != null)
            {
                currentPresenter.Dismiss();
                currentPresenter.Navigator = null;
            }
        }