This project is read-only.

Question about BusinessBase.MarkChanged/INotifyPropertyChanged

Topics: Business Logic Layer
Oct 13, 2010 at 12:50 AM

Is the INotifyPropertyChanged implementation on BusinessBase derived classes actually being used anywhere in BlogEngine? I can't seem to find any references to it in terms of other objects attaching event listeners to a BusinessBase's PropertyChanged event.

The reason I ask is because the implementation of it seems fundamentally flawed. On all the property setters that use MarkChanged, MarkChanged(and then the PropertyChanged event) is being called prior to the property's actual value being changed. A listener should reasonably expect that if PropertyChanged is raised, then the property has actually changed already.

Is this safe to upload a fix for, or is there something more deeply rooted into the system that I should be aware of?

Oct 13, 2010 at 11:20 AM

Hi, good observation.  I don't think there's any BE code that is subscribed to Property Changed events.  Someone might have their own custom code that does so.  But I don't think switching the order is going to break anyone's custom code.  And it looks like you're right that the correct order is to raise the Changed event after the property has been changed.  So, if you do upload a fix, that would be a good improvement and we'll apply the fix.  Thanks & great observation!