What is a dependency property?

e11s picture e11s · Mar 6, 2009 · Viewed 58.4k times · Source

What is a dependency property in .Net (especially in WPF context). What is the difference from the regular property?

Answer

Matt Hamilton picture Matt Hamilton · Mar 6, 2009

Dependency properties are properties of classes that derive from DependencyObject, and they're special in that rather than simply using a backing field to store their value, they use some helper methods on DependencyObject.

The nicest thing about them is that they have all the plumbing for data binding built in. If you bind something to them, they'll notify it when they change.