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) { 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 StepSelectedHandler(object sender, ExecutedRoutedEventArgs args) { if (!IsLinear) { StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, Controller.ActiveStep, ((StepperStepViewModel)args.Parameter).Step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { Controller.GotoStep((StepperStepViewModel)args.Parameter); } } }
private void StepSelectedHandler(StepperStepViewModel stepperStepViewModel) { if (!IsLinear) { StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, Controller.ActiveStep, stepperStepViewModel.Step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { Controller.GotoStep(stepperStepViewModel); } } }
private void SelectStep(IStep step) { if (step != null && step != Controller.ActiveStep && !IsLinear) { bool isValid = ValidateActiveStep(); StepperStepViewModel activeStepViewModel = Controller.ActiveStepViewModel; StepperStepViewModel nextStepViewModel = Controller.InternalSteps.FirstOrDefault(stepViewModel => stepViewModel.Step == step); if (BlockNavigationOnValidationErrors && !isValid && (nextStepViewModel == null || nextStepViewModel.Number > activeStepViewModel.Number)) { RaiseNavigationCanceledByValidation(); return; } StepperNavigationEventArgs navigationArgs = new StepperNavigationEventArgs(StepNavigationEvent, this, Controller.ActiveStep, step, false); RaiseEvent(navigationArgs); if (StepNavigationCommand != null && StepNavigationCommand.CanExecute(navigationArgs)) { StepNavigationCommand.Execute(navigationArgs); } if (!navigationArgs.Cancel) { Controller.GotoStep(step); } else { // refresh the property with the old state ActiveStep = Controller.ActiveStep; } } }