Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

17. Dependency Properties > Fitting It In

Fitting It In

image

We’ve seen that .NET Framework types have four kinds of members: fields, properties, methods and events. Dependency properties don’t change that. Just like regular .NET properties, dependency properties are implemented using fields and properties. The magic happens when you register the property with the dependency property system and use WPF GetValue() and SetValue() to change the value of the backing field instead of setting the value directly.

image
image

Words for the Wise

image

Remember that a private field that stores the values associated with a standard .NET property is called a BACKING FIELD. In WPF, the field associated with the property is the dependency property, and it is said to WRAP the standard .NET property, not BACK it. It’s a difference in perspective that’s reflected in the terminology.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial