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

Range Slider Thumb Color

2 Answers 136 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Heather Kyle
Top achievements
Rank 2
Heather Kyle asked on 29 Jan 2010, 10:21 PM
I am going to be adding a number of range sliders to a control, dynamically at runtime. Ideally, they will all have the same style, except for the thumb color. Is it possible to dynamically set the color of a Range Slider 'HorizontalRangeMiddleThumb' at run-time?

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 01 Feb 2010, 01:43 PM
Hello Heather Kyle,

This functionality is not supported by the control.

You can apply  a custom theme to RadSlider. For more information you can follow the link below:
http://www.telerik.com/help/silverlight/radcontrols-for-silverlight-expression-blend-support.html

If you have further  questions please do not hesitate to ask us.
I hope this will help you.

Best wishes,
Dimitrina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Heather Kyle
Top achievements
Rank 2
answered on 01 Feb 2010, 05:50 PM
I actually found a fairly easy work-around for this problem. I set the background color for the thumb to a SolidColorBrush that was defined in the Control.Resources. I manipulate that color through a property in the code-behind, and voilĂ --the thumbs are the colors I want them to be.
In the .xaml file:
<Canvas.Resources> 
        <SolidColorBrush x:Key="BackgroundBrush" Color="DarkGray" /> 
... 
        <Border Background="{StaticResource BackgroundBrush}" /> 
... 
</Canvas.Resources> 

And in the .cs file:
public Color BackgroundColor 
     set 
     { 
          if (this.Resources.Contains("BackgroundBrush")) 
          { 
               object brush = this.Resources["BackgroundBrush"]; 
               if (brush != null
               (brush as SolidColorBrush).Color = value; 
          } 
     } 

Tags
Slider
Asked by
Heather Kyle
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Heather Kyle
Top achievements
Rank 2
Share this question
or