views:

966

answers:

1

I have a class derived from System.Windows.Controls.UserControl, and I need to add a PropertyChangedCallback to the FrameworkElement.Margin dependency-property.

How is this accomplished from my C# code? I can't find any good examples of this in MSDN.

+2  A: 

You can do this via calling OverrideMetadata in your UserControl.

This provides the means to merge PropertyChangedCallback characteristics. For details, see the MSDN page for Dependency Property Metadata (search for the section titled "Overriding Metadata").

Reed Copsey