New to WPF so I’m sure it’s an easy one this; for every control of a certain type/s, I want to set a property to the same value. The property is telerik:Theming.Theme and I would like to apply the same value to all telerik: controls. If there’s no way to do this then how do I use a resource to define this value and refer to the resource in the controls?
Thanks.
You may override the default value of any dependency property for a specific control type (precisely a specific type of dependency object) by DependencyProperty.OverrideMetadata in your application initialization code (e.g. the static constructor of your MainWindow):
where SomeControlClass is the (base) class that you want to give a new default value for the Theme property, and SomeDefaultValue is the new default value.
Note also that
Theming.ThemePropertyseems to be obsolete and will be replaced byStyleManager.ThemeProperty.