Hi,
I have noticed that utility of SfDataForm is somewhat diminished with the way it's validation was realized.
- It's hard to do custom validation.
- It's not aligned with MVVM architecture, where validation should be performed in viewmodel.
I would suggest to, instead of having the form perform validation, have it delegate validation to other parties (viewmodel for example), and then bind to observable object that contains errors for each property. Object to bind to could have the standard IDataErrorInfo contract, providing all the necessary events and data.
SfData form could provide following:
- Bindable property for observable error list where errors can be associated with property names
- View section for errors not associated with any property (or associated with multiple properties)
- A Command with property name parameter to bind validation logic for single property
- A Command without parameters to bind validation logic for the whole data object.
Soo, that's the general idea, I think it would make the component much easier to work with.
And if there is a way to have viewmodel perform the validation right now, please let me know. Thanks!