WPF Dependency Property vs INotifyPropertyChanged

By | May 26, 2015

When to use WPF Dependency Property vs INotifyPropertyChanged?

A little background:
WPF databinding has two essential parts: Source and Target.
Now Target has to be a Dependency Property.
But source can be a simple property with INotifyPropertyChanged implemented. Or a Dependency property.
In both cases, any change to the property will see the UI getting updated.
So back to the question.
Which one?

Well it is a matter of choice (and debate). Making the source property a dependency object does make the code very simple. But making it a Dependency Property is a bit involved. I keep the source property as a plain .NET property. And implement the INotifyPropertyChanged.

If I am writing a custom control only then I create the dependency properties (mainly because I do not have a choice).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.