Validation of Complex Properties currently not supported by Stylet #285
MrCoffeeAtGitHub
started this conversation in
Ideas
Replies: 1 comment
-
So your problem is that you extend |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've found this old thread, but I'd like to open a new one even it is simular issue
I changed the Stylet-Example of Validating to reproduce the issue in my own fork (https://github.com/MrCoffeeAtGitHub/Stylet/tree/ComplexPropertyValidation)
Mainly, I moved from the properties out of ViewModel into an own Model and using this.
At the ViewModel, I instanciate that and provide it a property for this:
The validation itself is now in two classes so we can reuse the code of UserModelValidator and IoC instanciates it correctly.
The validation runs and finds all errors so submit is blocked but the fields aren't marked as error (red) anymore. The interface INotifyDataErrorInfo is not implemented in PropertyBase so, I'd need to implement it by myself but I think this would great if Stylet could do this in PropertyBase, so all properties could be checked. This has been already discussed on Stackoverflow and Social MSDN.
What is your opinion about this?
Beta Was this translation helpful? Give feedback.
All reactions