[CallerMemberName] string PropertyName = ""//传当前属性的值
INotifyPropertyChanged
?.//判断是否为空再执行
public class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged([CallerMemberName] string PropertyName = "") { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName)); } }
//更改通知
///
WA4
///
标签:CallerMemberName,INotifyPropertyChanged,更改,通知,PropertyName,PropertyChanged,publi From: https://www.cnblogs.com/PIPTWY/p/17388173.html