It should be possible to specify a validate() method on each viewmodel that gets triggered each time a new model value is .set(). In case of an unsuccessful validation an error event or binding could be triggered.
Hello,
We have the Validator integrated into the Form component which can be instantiated via MVVM syntax and can serve as a better alternative as you have the ability to create an entire form with a good looking predefined layout and have the validation on hand.
https://demos.telerik.com/kendo-ui/form/mvvm
Regards,
Ianko
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
If the validator had binding support, It might look something like this: <div id="container" data-role="validator" data-bind="rules: rules, events:{validate: onValidate}"> <input...... </div> One issue that I can think of is that the rules engine would need to have a model bound mode rather than dom. The viewmodel should only have concerns with the bound data rather than inspecting input elements.