Firstly, I will be able to point to the issue in a better direction, because I will explain the context of the problem.
I have to implement an egg-like system on an object. There is a series of dependency properties in the object. Some are double, int, string but some dependency objects are also of type. I need to save the value of the property before it changed, and for this I added the CoerceValueCallback.
public static read-only DependencyProperty MyBackgroundProperty = DependencyProperty.Register ( "MyBackground", typeof (MyCustomizableBackground), typeof (MyComponent), New UIPropertyMetadata (default (MyCustomizableBackground), null, New CoerceValueCallback (for OnPropertyChanging)));
In OnPropertyChanging I'm changing the value before it has changed the MyCustomizableBackground dependency object in which there are some dependency properties.
The problem is that in this case, where I have a custom object as a property, OnPropertyChanging method does not trigger, but when I have a common type, it is triggered.
Later edit: I realized that a part of my question was quite ambiguous and I asked a different question. For the first part of the problem, Julien pointed me towards a better direction.
The property changed callback is not as the third second parameter of the manufacturer in your case, you used Value is rape callback which
edit:. In response to your comment, double check that MyComponent is the owner of good property type.
Comments
Post a Comment