Is there a way to validate a textbox input (using Regex) in a wpf application using Caliburn.Micro?
Thanks
Is there a way to validate a textbox input (using Regex) in a wpf application using Caliburn.Micro?
Thanks
I'd suggest using an attribute-based approach. Have a look at this article:
The approach here is basically:
Inherit from a validation viewmodel base-class. This, in turn, could inherit from the Caliburn Screen/Conductor/etc base-classes quite happily
Once this is done all you need to is attribute up the properties you want to validate. This fits in really nicely with the CM approach.
I wrote a small plugin for CM to enable fluent builder-style validation. Feel free to use it: https://github.com/AIexandr/Caliburn.Micro.Validation
I'd suggest using an attribute-based approach. Have a look at this article:
The approach here is basically:
Inherit from a validation viewmodel base-class. This, in turn, could inherit from the Caliburn Screen/Conductor/etc base-classes quite happily
Once this is done all you need to is attribute up the properties you want to validate. This fits in really nicely with the CM approach.
© 2022 - 2024 — McMap. All rights reserved.