Chris Donnan : Programming - Brooklyn Style
software, trading, family, fun
Posted programming on Monday, May 28th, 2007.
Attached Properties is another use of the dependency object infrastructure. This stuff is a set of real underpinnings of WPF and is very very related to XAML. Attached Properties seem to be specifically useful to someone writing a class that will be used in XAML.
This just about sums it up:
One purpose of an attached property is to allow different child elements to specify unique values for a property that is actually defined in a parent element.
Now in XAML - this looks like this:

The CheckBox has an attached property that is refering to it’s parent DockPanel. This is a nice convenience for XAML style declarative programming - and I see how/ why this whole dependency property, attached property business is around.
The other stuff that still seems strange to me is all of the static metadata stuff that has to be done to register all of these dependency properties, attached properties etc with WPF.

Anyow - again - my 2 yr old is callin’ me
-Chris
Comment on this post below
You must be logged in to post a comment.
You can leave a response, or trackback from your own site.















