This is a really simple question, but I was wondering if someone could explain what the 4th line is actually doing? so the first line gives an event to the handler. I don't really know in what circumstances handler will return null or what the last line does.
When you pass the handler your object and which property changed, what does it do with them?
PropertyChangedEventHandler handler = PropertyChanged; //property changed is the event
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
I assume I used this to get this code but I would like to understand what it is doing fully.
PropertyChangedEventHandler
. That's just how handlers work. – Chlorohandler
, and initializes it with the value ofPropertyChanged
... which might be null. – Mellissamellitz