Skip to content

How to get rid of INotifyPropertyChanging? #637

Answered by Sergio0694
mikeKuester asked this question in Q&A
Discussion options

You must be logged in to vote

"I know, that the "changing" events will never be used and in order to improve the performance, I don't want all these OnPropertyChanging calls."

That is unlikely to make any observable difference, especially if you're using the source generator for your observable property. That's because the generator will also generate and cache all the PropertyChangingEventArgs for each property, so the OnPropertyChanging call will simply do nothing. As in, it will see the event is null, and just not even raise it at all.

On the other hand, using ObservableObject is recommended because it allows you to reuse the same base code across all your viewmodels, whereas if you used [INotifyPropertyChanged]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikeKuester
Comment options

Answer selected by Sergio0694
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants