Wednesday, March 16, 2011

WPF: define attached property or dependency property

When to define dependency property and when to define attached property.

- Define attached property, if you want to give your user the ability to default this property to a control and to all of its descendents as well.
- Define attached property, when you want all different kinds of controls to have the capability to carry this property with them. May be because they could be children of your control/panel so you give them the ability to assign this property so they can participate in deciding how to be laid in your panel.

No comments: