I learnt about WPF notifications against classes

I had an interesting issue. I had created a class to encapsulate a “Value”, an “OriginalValue” and a “IsDirty” value. As styling relied on the “IsDirty” flag I have to bind to the actual class itself, not just the value property.

Also this means that when it comes to render the value in a textbox, for example, it needs the “Value” property. This can be solved with a value converter.

However when the underlying value was updated it was not refreshing the binding due to the converter in-between and the binding looking at the class, not the property. I don’t believe it is possible to fire a property changed notification against a class instance, as opposed to a property.

The solution was to include an “Instance” property in the class that just returns itself. The binding is then done against this property – not the actual instance of the class. So when the value is updated it fires a property changed notification against the “Instance” property as well, which forces the binding refresh.