Styling buttons

2 posts, 0 answers
  1. Or
    Or avatar
    3 posts
    Member since:
    Sep 2017

    Posted 13 Nov 2017 Link to this post

    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?

  2. Martin
    Admin
    Martin avatar
    126 posts

    Posted 15 Nov 2017 Link to this post

    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.
Back to Top