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

Setting Same Colors for Light 7 Dark Theme

2 Answers 105 Views
ToggleSwitch
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron
Top achievements
Rank 1
Aaron asked on 25 Dec 2012, 08:38 PM
I am using a dark background for all my pages so would like the same look and feel for the ToggleSwitch whether it is in Light theme or Dark them.  The actual toggle button (not the checked or unchecked background) is White on Dark Theme and Black on Light Theme.  I would like the button to be filled White in both modes.

 I have attached images ToggleDark.png and ToggleLight.png with this post.  I just want the control to look the same in both Dark and Light themes.  I would like the control to look like image ToggleDark.png in both modes if that is possible.

I have got the following code so far:

xmlns:Controls1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"

xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

xmlns:telerikToggleSwitch="clr-namespace:Telerik.Windows.Controls.ToggleSwitch;assembly=Telerik.Windows.Controls.Primitives"

<Controls1:RadToggleSwitch x:Name="tsSettings" Header="show settings?" Foreground="White" IsChecked="False">

<Controls1:RadToggleSwitch.HeaderTemplate>

<DataTemplate>

<ContentControl Foreground="White" Background="White" Content="{Binding}"/>

</DataTemplate>

</Controls1:RadToggleSwitch.HeaderTemplate>

<Controls1:RadToggleSwitch.ButtonStyle>

<Style TargetType="telerikToggleSwitch:ToggleSwitchButton">

<Setter Property="CheckBackground" Value="#FFFF0000"/>

<Setter Property="Background" Value="White"/>

<Setter Property="BorderBrush" Value="White"/>

</Style>

</Controls1:RadToggleSwitch.ButtonStyle>

</Controls1:RadToggleSwitch>


Thanks for all your help :)

2 Answers, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 28 Dec 2012, 09:09 AM
Hi Aaron,

Here's how you can change the color for the ToggleSwitch button:
<telerikPrimitives:RadToggleSwitch.ButtonStyle>
    <Style TargetType="telerikToggleSwitch:ToggleSwitchButton">
        <Setter Property="ThumbBackground" Value="Green"/>
    </Style>
</telerikPrimitives:RadToggleSwitch.ButtonStyle>

Let me know if you need additional assistance.

All the best,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Aaron
Top achievements
Rank 1
answered on 05 Jan 2013, 08:19 PM
Thank you!
Tags
ToggleSwitch
Asked by
Aaron
Top achievements
Rank 1
Answers by
Todor
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or