I have a slider that is on a white background. The default knob color is white for a metro slider. Is there a simple way to change the color of it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to manually control the style of the slider, you need to update select the Slider then use the Format->Edit Style->Edit Copy command on the toolbar.
You will need to find the following in the Style XAML…
You can then set the background colors here. This creates a single style that can be used. Be aware of two things…
1. You may want to look at the VisualStateManager states and see how the colors are changed as the slider is used and make adjustments there as necessary
2. By going this route, you are breaking the ability of the slider to adjust to the user selecting different device themes. For example, if the user selects a dark theme and you are reflecting some of that using the built-in templates, you can get controls that will not look good with a given theme. A simple example (though not applicable since it sounds like you are setting the page background color explicitly) is if someone changed the slider color to black using this approach, not accounting for the fact that they are developing using the light theme and the user may be using the dark theme. Hopefully that makes sense.