&tag(INotifyPropertyChanged);

目次[edit]

参考情報[edit]

定義[edit]

namespace System.ComponentModel
{
    // 概要:
    //     プロパティ値が変更されたことをクライアントに通知します。
    public interface INotifyPropertyChanged
    {
        // 概要:
        //     プロパティ値が変更されたときに発生します。
        event PropertyChangedEventHandler PropertyChanged;
    }
}

使用方法[edit]

典型的な実装[edit]

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");
            }
        }
    }

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS