Google News
logo
WPF - Interview Questions
What are Dependency properties in WPF?
WPF dependency properties are properties that extend the functionality of CLR (Common Language Runtime) properties. Dependency properties are those whose value is dependent on external sources (value from other inputs), such as animation, data binding, styles, themes, and user preferences, or visual tree inheritance. These properties provide self-contained validation, default values, monitoring of changed properties, and other runtime information. 
 
 
Advantages of Dependency Property :
 
* Dependency Property is not stored every time, but only when it is modified or changed. As a result, memory consumption is reduced.

* The DependencyProperty is notified whenever a property's value changes via INotifyPropertyChange. As a result, data binding becomes simpler since changes are immediately reflected in the value.

* Dependency Properties are capable of supporting animation, setting styles via style setters, and even providing control templates.
Advertisement