spiegelp / MaterialDesignExtensions

Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
https://spiegelp.github.io/MaterialDesignExtensions/
MIT License
754 stars 122 forks source link

Get the validation state of a control in a stepper data template inside ViewModel #66

Closed WaffleBuffer closed 4 years ago

WaffleBuffer commented 4 years ago

I wanted to know if it was possible to get the validation state of control (such as textbox) which is located inside the Datatemplate of Step inside its ViewModel. This is with the scenario of having some ValidationRules on the TextBox and trying to synchronize them with the HasValidationError of the Step.

enrmadriv commented 4 years ago

You can add HasError property to the ViewModel of your step, do your validation and assign the result to this property. Then use Validate method provided by StepperControl to notice the change.

I achieve something similar.

WaffleBuffer commented 4 years ago

That's what i have done in the end ^^. Sorry i forgot to update this issue.