Proposal: Data Annotation Validation Behavior for .NET MAUI (Contribution) #2790
jglstrausss
started this conversation in
New Feature Discussions
Replies: 1 comment 5 replies
-
I really like this idea and would love to see the prototype. The only thing that I would want to highlight is to that we aim to avoid using any reflection when possible. Code that looks up usages of attributes may be ok here though |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’d like to start a discussion around contributing a new "DataAnnotationValidationBehavior" to the CommunityToolkit for .NET MAUI.
Data annotation attributes (like [Required], [StringLength], [EmailAddress], etc.) are a natural fit for .NET developers coming from MVC or MVVM validation patterns. Currently, MAUI provides ValidationBehavior, but it doesn’t support model-based data annotation validation out of the box.
To fill this gap, I’ve created a working prototype behavior that:
I'd like to propose adding this behavior into the toolkit under CommunityToolkit.Maui.Behaviors, making data annotation-based validation more accessible to MAUI devs.
Before I go further, I’d love to:
If there's interest, I’d be happy to clean up the code, write tests, and follow contribution guidelines.
Beta Was this translation helpful? Give feedback.
All reactions