How to get rid of INotifyPropertyChanging? #637
-
Hi, Lets say I have a large number of instances of a view models and want to force the source generator, just to implement the code for Instead of inheriting from The resulting code is not the same: using the The warning is ok if I use the Is there anything what I'm missing here? Thank for your work for the toolkit and |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 On the other hand, using I would recommend just inheriting from If you really want to, you can also set |
Beta Was this translation helpful? Give feedback.
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 theOnPropertyChanging
call will simply do nothing. As in, it will see the event isnull
, 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]
…