Nested styles with RadToolBar

2 posts, 0 answers
  1. Peter
    Peter avatar
    37 posts
    Member since:
    Dec 2011

    Posted 26 Nov 2013 Link to this post

    I was trying to apply a nested style on a RadToolbar and on its children. I had problems applying the style to certain children like RadButtons and RadToggleButtons. The same occurs with normal WPF Toolbars:

    http://stackoverflow.com/questions/20219595/wpf-why-are-nested-styles-not-always-working/20220084?noredirect=1#20220084

    The solution is, that you have to override the special style, that the Toolbar defines for Buttons, ToggleButtons etc. For this you need the Toolbar's ToggleButtonStyle Resourcekey which is provided by a normal WPF Toolbar via

    public static ResourceKey ToggleButtonStyleKey { get; }
    Where do I find this resource Key on a RadToolBar and how do I apply a nested style on all RadButtons/RadToggleButtons of  a RadToobar?
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Nov 2013 Link to this post

    Hi Peter,

    We have sample in our XAML GitHub which demonstrates how to apply custom styles for elements placed in RadToolBar. Please check out the CustomStyledElements sample here. In XAML there are several comments sections providing details.

    We hop this will help you proceed further.

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top