Tutorial by Examples

The implementation of INotifyPropertyChange can be error-prone, as the interface requires specifying property name as a string. In order to make the implementation more robust, an attribute CallerMemberName can be used. class C : INotifyPropertyChanged { // backing field int offset; ...
The NotifyPropertyChangedBaseclass below defines a generic Set method that can be called from any derived type. public class NotifyPropertyChangedBase : INotifyPropertyChanged { protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) => PropertyChanged?.Invo...

Page 1 of 1