CommandBarToggleButton and SetThemeValueOverride

3 posts, 0 answers
  1. Guy
    Guy avatar
    2 posts
    Member since:
    Jan 2013

    Posted 30 Oct 2017 Link to this post

    I am trying to override the background theme colour for a CommandBarToggleButton (in default visual state ie untoggled). Below is what I have (but not working) - help appreciated!

    CommandBarToggleButton button = new ...

    button.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.BackColorProperty, Color.LightGreen, "", typeof(Telerik.WinControls.Primitives.FillPrimitive));

    button.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.GradientStyleProperty, GradientStyles.Solid, "", typeof(Telerik.WinControls.Primitives.FillPrimitive));

  2. Dimitar
    Dimitar avatar
    2892 posts

    Posted 31 Oct 2017 Link to this post

    Hi Guy,

    There is no need to specify the type in this case. You can use the following code (the button is inheriting LightVisualElement):
    commandBarToggleButton1.SetThemeValueOverride(LightVisualElement.BackColorProperty, Color.Red, "" );
    commandBarToggleButton1.SetThemeValueOverride(LightVisualElement.GradientStyleProperty, GradientStyles.Solid, "" );

    I hope this will be useful. Let me know if you have additional questions.

    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Guy
    Guy avatar
    2 posts
    Member since:
    Jan 2013

    Posted 31 Oct 2017 Link to this post

Back to Top