I have a WPF-application in Visual Studio 2010 containing a CustomControl with a DependencyObject as DependencyProperty. It seems to be impossible to set any DefaultValue in FrameworkPropertyMetadata because of an ArgumentException.
I inherit Freezable instead of DependencyObject, which makes it possible to set a Default in FrameworkPropertyMetadata, but this has some strange effects after reset:
The sub-properties are not updated in the property-window and couldn't be changed anymore until the CustomControl is deselected an then selected again. After the property-window is updated this way and changing the brush by the
slider in the brush-editor the brush-editor is closed immediately after a minimal change. Doing this a second time the brush could be changed this way. But the corresponding xaml-entry isn't updated until clicking outside the CustomControl. Can anyone reproduce
or solve this problem? Is there another possibility to register a default for a DependencyObject?
public class MyButton : Button
public static readonly DependencyProperty ColorSchemeProperty;
public static readonly DependencyProperty ColorSc
View Complete Post