I have a custom control derived from Button:
class MyControl : Button{}
And suppose, this class is empty (has no members).
In t
You override the DefaultStyleKey's metadata in your static constructor:
static MyControl()
{
DefaultStyleKeyProperty.OverrideMetadata(
typeof(MyControl),
new FrameworkPropertyMetadata(typeof(MyControl)));
}
Then, in your resources, you can base its style on the button:
I've tried in the past to override the DefaultStyleKey's metadata to point to the base class (Button in your case), but it doesn't seem to work.