private bool AllowMoveToStep(T fromStep, T toStep) { WizardStepCollection steps = this.WizardSteps; int fromStepIndex; if (fromStep != null) { fromStepIndex = steps.IndexOf(fromStep); } else { fromStepIndex = 0; } int toStepIndex = steps.IndexOf(toStep); if (this.IsForwardNavigation(fromStep, toStep)) { for (int i = fromStepIndex; i < toStepIndex; i++) { if (!steps[i].IsCompleted) { return(false); } } return(true); } else { return(true); } }
private bool TryGetPreviousStep(T fromStep, out T previousStep) { WizardStepCollection steps = this.WizardSteps; int index = steps.IndexOf(fromStep); if (index == 0) { previousStep = null; return(false); } else { previousStep = (T)steps[--index]; return(true); } }