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

CommandBarToggleButton and SetThemeValueOverride

2 Answers 141 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 30 Oct 2017, 01:43 PM

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 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 31 Oct 2017, 07:54 AM
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.

Regards,
Dimitar
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.
0
Guy
Top achievements
Rank 1
answered on 31 Oct 2017, 01:38 PM
Thanks!
Tags
CommandBar
Asked by
Guy
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Guy
Top achievements
Rank 1
Share this question
or