How can I change the default value for an inherited dependency property? In our case, we\'ve created a subclass of Control which by default has its Focusable
s
The correct way to override a base class's property is:
static TestControl() {
FooProperty.OverrideMetadata(
typeof(TestControl),
new FrameworkPropertyMetadata(67)
);
}
EDIT:
AddOwner
is meant to share the same DependencyProperty
across types that are not related (i.e. the TextProperty
of TextBox
and TextBlock
).