Validating event with the '?' [duplicate]

0

I was implementing a method to throw the event PropertyChanged of INotifyPropertyChanged . I did the event validation in the traditional way, ie with if (PropertyChanged != null) . But VS suggested a leaner form that is PropertyChanged?.Invoke ( this, new PropertyChangedEventArgs ( propertyName ) ); .

Of course, the code is self-explanatory, that is, "If PropertyChanged is not null, execute method Invoke ". But I wanted to know what this feature is called so I can search more information about it.

    
asked by anonymous 18.12.2016 / 00:18

1 answer

1

It's called "Null-Conditional operator". More information here:

link

    
18.12.2016 / 00:23