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; }
public NavigationService(IEnumerable <INavigationStep> steps) { Steps = steps; CurrentStep = steps.FirstOrDefault(s => s.IsAllowed); if (CurrentStep == null) { throw Errors.NoAvailableSteps(); } }
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); }
public void AddStep(INavigationStep step) { this._steps.Add(step); step.Changed += this.StepOnChanged; }