Attributes-based validation in a WPF MVVM application
.Net, CodeProject, WPF July 29th, 2010Today, I’m proud to share with you my very first article available on CodeProject. This article presents a technique which can be used in order to add validation in a WPF MVVM application based on attribute. Basically, it means that you can write validation logic like that (notice the attribute associated to this property):
1 2 3 4 5 6 7 8 9 10 11 12 13 | [Required(ErrorMessage = "Field 'FirstName' is required.")] public string FirstName { get { return this.firstName; } set { this.firstName = value; this.OnPropertyChanged("FirstName"); } } |
Of course the article comes with a nice demo application:
You can read the full article here: Attributes-based validation in a WPF MVVM application



Recent Comments