I saw the following template used to implement INotifyPropertyChanged
private void NotifyPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } public event PropertyChangedEventHandler PropertyChanged;
Can someone explain to me the need to assign var handler = PropertyChanged before checking it for null or directly for checking PropertyChanged == null ?
thanks
Kylelib
source share