MVVM WPF 简化 类的开发
2021-03-05 19:28
标签:logs hang this http cal blog arch string www https://www.cnblogs.com/li-peng/p/3169864.html https://www.cnblogs.com/ColdJokeLife/archive/2013/05/30/3108112.html //C#5.0 版本 MVVM WPF 简化 类的开发 标签:logs hang this http cal blog arch string www 原文地址:https://www.cnblogs.com/DotNet1010/p/12887226.html
public abstract class ObservableObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void SetProperty
{
if (EqualityComparer
{
return;
}
field = value;
var handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}public class Person : NotifyPropertyChangedEx
{
private string name;
public string Name
{
get { return name; }
set { this.SetProperty(ref name, value); }
}