In my new WPF Application, I am reusing a Model class. In that model class, all the properties, in their setters, fire NotifyPropertyChanged. In my application, I do not really have a use case of firing INPC for individual property.
I need to know that if I keep the current architecture where individual properties fire INPC every time they get changed, will it cause any performance implications? Does it make sense to have individual properties fire INPC when it is not required?
In my new WPF Application, I am reusing a Model class. In that model
Share
Generally speaking, anytime you are running a piece of code that you don’t have to, you are potentially causing performance issues.
As a rule of thumb, when you write your setters for your properties instead of just setting your backing field and raising the change event, you should check the equality before you notify, thus avoiding unnecessary updates.
for example:
you should also check for attached events in your
RaiseChangedEventmethods, so if there are no listeners, you don’t throw a null reference exception and you don’t unnecessarily make a call: