Silverlight dependency property not updating
Here you can find a demo project with full source code. I noticed while working with Attached Properties and Dependency Properties that the code snippet is wrong. My guess is that this is an older version of the Register methods.This example shows how to override default dependency property metadata that comes from an inherited class, by calling the Override Metadata method and providing type-specific metadata.By defining its Property Metadata, a class can define the dependency property's behaviors, such as its default value and property system callbacks.But creating the enum with a value of –1 doesn’t work: This is why setting –1 to the default value of the dependency property doesn’t work (unless you of course have a –1 value in the enum!So I have been using Dependency Properties on Templated Controls and had no issues...There, the UIProperty Meta Data can be used for Attached Properties and DPs.I suggest leaving these untouched and creating new snippets named (for instance) slpropa and slpropdp.
I’ve put the implementation details into a It is not possible to listen for dependency property values which are inherited like the Font Size, Data Context and Font Family properties so far.
I am now making a User Control that is derived from a Template Control...
The class "Toolbar" is a Templated Control and is the base for other toolbars.
A class that inherits the dependency property through its class inheritance can override the original metadata so that the characteristics of the property that can be altered through metadata will match any subclass-specific requirements.
Overriding metadata on a dependency property must be done prior to that property being placed in use by the property system (this equates to the time that specific instances of objects that register the property are instantiated).