&tag(INotifyPropertyChanged);
namespace System.ComponentModel
{
// 概要:
// プロパティ値が変更されたことをクライアントに通知します。
public interface INotifyPropertyChanged
{
// 概要:
// プロパティ値が変更されたときに発生します。
event PropertyChangedEventHandler PropertyChanged;
}
}
public class DemoCustomer : INotifyPropertyChanged
{
private void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
private string companyNameValue = String.Empty;
public string CompanyName
{
get
{
return this.companyNameValue;
}
set
{
if (value != this.companyNameValue)
{
this.companyNameValue = value;
NotifyPropertyChanged("CompanyName");
}
}
}