/// <summary>Called when the Back button is clicked. If the event is not canceled, the wizard will navigate to the /// next step. /// </summary> protected virtual void OnNextButtonClicked(CancelEventArgs e) { if(CurrentStepIndex != -1) CurrentStep.OnNextButtonClicked(e); if(NextButtonClicked != null) NextButtonClicked(this, e); if(!e.Cancel && CurrentStepIndex != -1) { if(DesignMode || CurrentStep.NextStep == null) // in design mode, we always want to move through the steps in { // order, so it's predictable and the user can access them all if(CurrentStepIndex < Steps.Count-1) CurrentStepIndex++; } else { CurrentStepIndex = CurrentStep.NextStep.Index; } } }