Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DataAnnotations and TagHelpers in WPF #2256

Open
VBAndCs opened this issue Nov 28, 2019 · 0 comments

Comments

@VBAndCs
Copy link

@VBAndCs VBAndCs commented Nov 28, 2019

I suggest that you allow using the attributes defined in System.ComponentModel.DataAnnotations with any property in a wpf project, like ASP.NET does. For example:

[Required]
[MinLength(2)]
[MaxLength(12)]
public string FirstName { get; set; }

ASP.NET generates server side validation code for these attributes (beside the client side validation scripts), so, I think you can make WPF borrow the class that generates the server side code to achieve this. Note: There are some attributes used with tag helpers to affect the UI such as DisplayAttribute. I think XAML should also add the tag helpers concept too. I find it easier and shorter than the currently used data binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.