|
using System.ComponentModel.DataAnnotations;
namespace WpfFormsWithValidationDemo.ViewModel
{
public class CompanyFormViewModel : FormViewModelBase
{
private string name;
private string address;
public CompanyFormViewModel() : base("Company")
{
}
[Required(ErrorMessage = "Field 'Name' is required.")]
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
this.OnPropertyChanged("Name");
}
}
[Required(ErrorMessage = "Field 'Address' is required.")]
public string Address
{
get
{
return this.address;
}
set
{
this.address = value;
this.OnPropertyChanged("Address");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.