阅读背景:

WPF:向客户端发出某一属性值已更改的通知INotifyPropertyChanged接口

来源:互联网 

Person.cs

 

using System.ComponentModel;

namespace _01_INotifyPropertyChanged
{
    class Person:INotifyPropertyChanged
    {
        private double height;
        private double weight;
        public double Height {
            set
            {
                this.height = value;
            }

            get
            {
                return height;
            }
        }
        public double Weight 
        {
            set
            {
                this.weight = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Weight"));
                }
            }

            get
            {
                return weight;
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
using System.ComponentModel;

n



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: