I am reading up iNotifyPropertyChanged in detail.
Can someone please clarify why do we need to check for
PropertyChanged !=null
?
Why would an event be null? Or in other words, why even check if it is null? The only time NotifyPropertyChanged
is called is when PropertyChanged
has been raised ( so it cannot be null), isn't it. Who/What can make it null?
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string info)
{
if (PropertyChanged != null)
{
PropertyChanged(this,new PropertyChangedEventArgs(info));
}
}
Thank you.