private void StepSelectedHandler(object sender, ExecutedRoutedEventArgs args) { if (!IsLinear) { bool isValid = ValidateActiveStep(); if (BlockNavigationOnValidationErrors && !isValid) { RaiseNavigationCanceledByValidation(); return; } StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, m_controller.ActiveStep, ((StepperStepViewModel)args.Parameter).Step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { m_controller.GotoStep((StepperStepViewModel)args.Parameter); } } }
private void SelectStep(IStep step) { if (step != null && step != m_controller.ActiveStep && !IsLinear) { bool isValid = ValidateActiveStep(); if (BlockNavigationOnValidationErrors && !isValid) { RaiseNavigationCanceledByValidation(); return; } StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, m_controller.ActiveStep, step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { m_controller.GotoStep(step); } else { // refresh the property with the old state ActiveStep = m_controller.ActiveStep; } } }
private void StepSelectedHandler(object sender, ExecutedRoutedEventArgs args) { if (!IsLinear) { StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, m_controller.ActiveStep, ((StepperStepViewModel)args.Parameter).Step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { m_controller.GotoStep((StepperStepViewModel)args.Parameter); } } }