1

What is the Dependency property in WPF and Silverlight.

Why we required and where we can use it.

Thanks...

Klaus Byskov Pedersen
  • 111,411
  • 28
  • 180
  • 220
Jitendra Jadav
  • 883
  • 3
  • 13
  • 26

2 Answers2

3

From the documentation:

The purpose of dependency properties is to provide a way to compute the value of a property based on the value of other inputs. These other inputs might include system properties such as themes and user preference, just-in-time property determination mechanisms such as data binding and animations/storyboards, multiple-use templates such as resources and styles, or values known through parent-child relationships with other elements in the element tree.

So they're like normal properties, but their value can be automatically computed from the values of other properties.

Frédéric Hamidi
  • 249,845
  • 40
  • 466
  • 467
1

There is a good article on dependency properties here:

http://www.betterthaneveryone.com/archive/2010/01/24/wpf-silverlight-xaml-and-dependency-properties.aspx

Fenton
  • 224,347
  • 65
  • 373
  • 385