After reading Internals of Dependeny Property in WPF I am wondering how Dependeny Properties are implemented in Silverlight for WP7. For the investigation Reflector and Dlls from xda forum were used.
In WPF:
A DependencyProperty maintains a static reference of all the DependencyProperty you register in WPF object hierarchy. It maintains a HashTable named PropertyFromName which it uses internally to get the DependencyProperty object. So in other word, each dependencyProperty object is registered in a global HashTable.
In Silverlight for WP7 DependencyProperties have almost the same global HashTable (actually it is
static Dictionary<Type, Dictionary<string, DependencyProperty>> _registeredProperties
)
But after looking through the source code of the GetValue and SetValue methods of the DependencyObject class I see that _registeredProperties is not used at all.
Does anybody know why it is implemented in such a way? Or maybe I've missed anything? Thank you in advance.