This is a migrated thread and some comments may be shown as answers.

Styling buttons

1 Answer 174 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Or
Top achievements
Rank 1
Or asked on 13 Nov 2017, 09:17 AM

I'm trying to change the default rad button style

However, when looking for RadButtonStyle I find it's defined in:

Styles.xaml
Telerik.xaml
Telerik.Windows.Controls.Diagrams.Extensions.xaml
Telerik.Windows.Controls.FileDialogs.xaml
Telerik.Windows.Controls.Input.xaml
Telerik.Windows.Controls.Navigation.xaml
Telerik.Windows.Controls.RibbonView.xaml
Telerik.Windows.Controls.RichTextBoxUI.xaml
Telerik.Windows.Controls.xaml

 

Why is it so, and which one should I change?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 15 Nov 2017, 01:06 PM
Hello,

We tend to duplicate the styles that we use as a base on for other styles in other dictionaries, as is the case with most of the buttons. What would apply to the instances that you would have in your project is the last added implicit one. In case you would like to modify the style of the RadButton in the general stand-alone state, you should add it after our dictionaries. The button is part of the Telerik.Windows.Controls.dll, so its style that is used as base resides originally in Telerik.Windows.Controls.xaml.

We have duplicated that style mainly for the cases in which its native resource dictionary is merged after the StaticResource references, since this might cause a XamlParseException. In the best case scenario, I would advice on creating and modifying a copy of the style and merging it after all the other dictionaries, so it would apply implicitly on any standalone instances, but preserve other occurrences in our controls that rely on our default style.

Regards,
Martin
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Buttons
Asked by
Or
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or