Friday, June 12, 2009

Dependencies Properties

•Silverlight provides a set of services that can be used to extend the functionality of a CLR property.
• A property that is backed by the Silverlight property system is known as a dependency property
•Simply put, a Dependency Property is like any other property but can hold a default value, with built in mechanism.
Dependency Properties Features

•Root class must be inherited from UIElement or DependencyObject
(E.g.., Controls, User Controls, Windows (WPF), or any class derived from UIElement (Button, List, Slider etc.))
•Dependency Properties have to be registered using DependencyProperty.Register method.
•Since DependencyProperty.Register is a static (C#) method, all dependency properties should also be static/ fields,
•also the property changed callback methods should be static/methods.
•Any property must be a dependency property if the property is being binded to.
•By convention, all Dependency Property fields should include the word “Property” at the end of the property name (
e.g., for property Value, the Dependency Property name should be ValueProperty

No comments:

Post a Comment