Closed AmitBhatnagar24 closed 4 years ago
@AmitBhatnagar24 Navigating back to previous steps even if validation failed could be a reasonable action. I will have a look at the behavior of the stepper and might change it in the next release.
thanks @spiegelp
I think it makes sense - can't proceed but shouldn't prevent you from backtracking to a previous step. Is there a way I can accomplish this with what you have currently? When do you expect the next release to happen?
@AmitBhatnagar24 You can accomplish the behavior with some own code (have a look into the API doc and the source code for details):
BlockNavigationOnValidationErrors = false
BackNavigation
event or register a BackNavigationCommand
StepperNavigationEventArgs
as argument on which you can set Cancel = true
to stop the navigation (some kind like args.Cancel = !args.CurrentStep.HasValidationErrors
)I do not have a schedule for the next stable release, but I may publish a pre-release around the mid of December.
@AmitBhatnagar24 I did a pre-release with the enhanced behavior some moments ago.
I'm again adding to this once closed issue because I still feel that I don't know exactly to handle the validation,
When I have a 2 Step stepper with BlockNavigationOnValidationErrors set to true. I have derived from Step to allow for validation as per the documents. If I reach step 2 and it fails validation.. why would it prevent me from going back a step? I feel that the BlockNavigationOnValidationErrors should only restrict going to the next step.
How can I accomplish this with the already implemented validation and events/commands already in play?
Originally posted by @AmitBhatnagar24 in https://github.com/spiegelp/MaterialDesignExtensions/issues/4#issuecomment-558943637