tags:

views:

58

answers:

2

What is the technical reason for not being able to update a DependencyProperty's metadata after it has already been set?

If you try to do something similar to below it will generate an exception saying:

Cannot change property metadata after it has been associated with a property.

MyProperty.DefaultMetata.PropertyChangedCallback = 
    new PropertyChangedCallback(MyMethod);
A: 

Hi, Does this question from Stackoverflow help any. WPF Property Callback

If that doesn't help. What do you mean by set, set in vs2k8 dev or set in the dll.

scope_creep
+1  A: 

Immutable objects have many benefits, one of which is thread-safety.

Also, metadata exists on a per-type basis; setting PropertyChangedCallback directly would effectively erase all other callbacks in the inheritance hierarchy.

Bryan Watts