#161 – Read a Dependency Property’s Metadata
December 20, 2010 Leave a comment
You can read a dependency property’s metadata by using the DependencyProperty.GetMetadata method.
For example, assume that we have a Dog class with a BirthYear dependency property and that the class has exposed BirthYearProperty as a public member. We can retrieve the property’s metadata as follows:
Dog fido = new Dog("Fido"); PropertyMetadata meta = Dog.BirthYearProperty.GetMetadata(fido);