Questions tagged «callermembername»

1
与实现INotifyPropertyChanged时的替代方法相比,[CallerMemberName]是否较慢?
有好文章提出了不同的实现方法INotifyPropertyChanged。 考虑以下基本实现: class BasicClass : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private void FirePropertyChanged(string propertyName) { var handler = PropertyChanged; if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); } private int sampleIntField; public int SampleIntProperty { get { return sampleIntField; } set { if (value != sampleIntField) { sampleIntField = value; …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.