The property system in WPF is pretty complex. MSDN really has a lot of information, but it is often hard to find. While there are many ways a DependencyProperty
can be set, I'm not sure that you need to care where the values are stored.
For local values, you can assume that it is stored on the DependencyObject
(again you shouldn't care where it is stored), with the caveat that they are not stored based on strings. It truly is associated with an instance of DependencyProperty
. This is why you would want to add an owner to the property. If somebody sets TextElement.FontSize
on your control, it is just like setting your local FontSize
property.
As far as inheriting values for a property from a parent, this only happens with attached properties. From the MSDN entry for FrameworkPropertyMetadataOptions
:
Although property value inheritance might appear to work for nonattached dependency properties, the inheritance behavior for a nonattached property through certain element boundaries in the runtime tree is undefined. Always use RegisterAttached to register properties where you specify Inherits in the metadata.