// This class implements a simple customer type // that implements the IPropertyChange interface. publicclass DemoCustomer : INotifyPropertyChanged { // These fields hold the values for the public properties. private Guid idValue = Guid.NewGuid(); privatestring customerName = String.Empty; privatestring companyNameValue = String.Empty; privatestring phoneNumberValue = String.Empty; publicevent PropertyChangedEventHandler PropertyChanged; privatevoid NotifyPropertyChanged(String info) { if (PropertyChanged !=null) { PropertyChanged(this, new PropertyChangedEventArgs(info)); } } // The constructor is private to enforce the factory pattern. private DemoCustomer() { customerName ="no data"; companyNameValue ="no data"; phoneNumberValue ="no data"; } // This is the public factory method. publicstatic DemoCustomer CreateNewCustomer() { returnnew DemoCustomer(); } // This property represents an ID, suitable // for use as a primary key in a database. public Guid ID { get { returnthis.idValue; } } publicstring CompanyName { get { returnthis.companyNameValue; } set { if (value !=this.companyNameValue) { this.companyNameValue = value; NotifyPropertyChanged("CompanyName"); } } } publicstring PhoneNumber { get { returnthis.phoneNumberValue; } set { if (value !=this.phoneNumberValue) { this.phoneNumberValue = value; NotifyPropertyChanged("PhoneNumber"); } } } }