public NavigationService(IEnumerable<INavigationStep> steps)
        {
            Steps = steps;

            CurrentStep = steps.FirstOrDefault(s => s.IsAllowed);
            if (CurrentStep == null)
                throw Errors.NoAvailableSteps();
        }
        private void OnCurrentStepChanged(INavigationStep newStep)
        {
            var isSummaryStep = newStep is ISummaryStep;
            var isImportStep  = newStep is IActionStep;

            ShowNavigateToPreviousStepButton = !isImportStep;
            ShowNavigateToNextStepButton     = !isImportStep && !isSummaryStep;
            ShowStartImportButton            = isSummaryStep;
            ShowStartNewImportButton         = ShowCancelImportButton = isImportStep;
        }
        private void OnCurrentStepChanged(INavigationStep newStep)
        {
            var isSummaryStep = newStep is ISummaryStep;
            var isImportStep = newStep is IActionStep;

            ShowNavigateToPreviousStepButton = !isImportStep;
            ShowNavigateToNextStepButton = !isImportStep && !isSummaryStep;
            ShowStartImportButton = isSummaryStep;
            ShowStartNewImportButton = ShowCancelImportButton = isImportStep;
        }
        public NavigationService(IEnumerable <INavigationStep> steps)
        {
            Steps = steps;

            CurrentStep = steps.FirstOrDefault(s => s.IsAllowed);
            if (CurrentStep == null)
            {
                throw Errors.NoAvailableSteps();
            }
        }
Ejemplo n.º 5
0
        public bool RemoveStep(INavigationStep step)
        {
            var removed = this._steps.Remove(step);

            if (removed)
            {
                step.Changed -= this.StepOnChanged;
            }

            return(removed);
        }
        protected override INavigationStep GetTargetStep()
        {
            var currentStep = NavigationService.CurrentStep;

            INavigationStep previousAllowedStep = null;

            foreach (var step in NavigationService.Steps)
            {
                if (step == currentStep)
                {
                    break;
                }

                if (step.IsAllowed)
                {
                    previousAllowedStep = step;
                }
            }

            return(previousAllowedStep);
        }
Ejemplo n.º 7
0
        public void AddStep(INavigationStep step)
        {
            this._steps.Add(step);

            step.Changed += this.StepOnChanged;
        }