Vitalii Vasylenko
Vitalii Vasylenko

Reputation: 4896

How to change SwitchButton button's color

Where can i set color of the SwitchButton button? By default, it is white, so on the white background its looking wierd. I set all possible brushes to noteable color (blue), but button is still white.

enter image description here

Upvotes: 1

Views: 80

Answers (1)

Chris W.
Chris W.

Reputation: 23280

Ideally, you probably want to just edit (or make a copy of) the original control template. Right click it, Edit Template->Edit and you can expose the objects in the template that make the background as well as the ones for the different states like MouseOver, IsChecked, etc and will allow you to do it directly to the object giving the current background. Which you often have to do if they dont have the Background property bound to the template you can specify with just Background="blah"

Which is what I would assume is the case since you have the background property set and it still doesn't show your change.

You could also expose that property in the template so from now on you could just specify Background="" by finding which object is that white background and changing its background property to;

Background="{TemplateBinding Background}"

Hope this helps.

Upvotes: 1

Related Questions