1

Closed

Can't change the color of RatingControl stars

description

Hi,

There doesn't seem to be an easy way to change the colors of the RatingControl's stars. The only way is to have the standard grey/white scheme.

Or am I missing something here?

Iwan
Closed Aug 14, 2013 at 7:21 PM by RohanTha

comments

shawnoster wrote Jul 29, 2013 at 7:55 AM

The trick is to provide a FilledItemStyle, something like this:

Add this to your resources for your page (or the app if multiple pages will use it):
    <phone:PhoneApplicationPage.Resources>              
        <Style TargetType="toolkit:RatingItem" x:Key="FancyFilledRatingItemStyle">
            <Setter Property="Background" Value="Gold" />
        </Style>                    
    </phone:PhoneApplicationPage.Resources>
And then to apply it to the control:
<toolkit:Rating 
    x:Name="RatingControl"                     
    FilledItemStyle="{StaticResource FancyFilledRatingItemStyle}"/>                    
You can also do the same for the unfilled portion as well. Hope this helps!

TripleMinds wrote Jul 29, 2013 at 7:44 PM

Thanks, that worked like a charm.

Iwan