Validating event with `?`operator

Asked

Viewed 15 times

0

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

It’s obvious that the code is self-explanatory, meaning, "If PropertyChanged is not null, execute the method Invoke". But I wanted to know what this resource is called so I can research more information about it.

1 answer

1


  • This link may be a good suggestion, but your reply will not be valid if one day the link crashes. In addition, it is important for the community to have content right here on the site. It would be better to include more details in your response. A summary of the content of the link would be helpful enough! Learn more about it in this item of our Community FAQ: We want answers that contain only links?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.