May 2007
M T W T F S S
« Apr   Jun »
 123456
78910111213
14151617181920
21222324252627
28293031  

Chris Donnan : Programming - Brooklyn Style

software, trading, family, fun

More on dependency objects and attached properties

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:

Xaml.png

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.

depprop1.png

Anyow - again - my 2 yr old is callin’ me :)

-Chris

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • blinkbits
  • BlinkList
  • blogmarks
  • YahooMyWeb
  • connotea
  • De.lirio.us
  • Fark
  • Furl
  • Reddit
  • description
  • Shadows
  • Smarking
  • Spurl
  • TailRank
  • Wists

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.