Wp8应用开发之toolkit:Rating

本篇主讲toolkit:Rating控件的使用:

因为自己要用到这个打分控件,所以了解了一下:

 

效果图:

 

因为控件本身没有填充的评分,所以需要对其style进行设置:

<toolkit:Rating Background="Transparent" ShowSelectionHelper="True" Value="5" RatingItemCount="5" >
    <toolkit:Rating.Resources>
        <!--选中的星星图片资源-->
        <ImageBrush x:Key="BrushStar" ImageSource="/Assets/starYes.png"></ImageBrush>
    </toolkit:Rating.Resources>
<toolkit:Rating.Style> <Style TargetType="toolkit:Rating"> <!-- 设置选中的星星样式--> <Setter Property="FilledItemStyle"> <Setter.Value> <Style TargetType="toolkit:RatingItem"> <Setter Property="Background" Value="{StaticResource BrushStar}" /> <Setter Property="BorderBrush" Value="#FFFDC132" /> <Setter Property="BorderThickness" Value="1" /> </Style> </Setter.Value> </Setter> <!-- 设置未选中的星星样式--> <Setter Property="UnfilledItemStyle"> <Setter.Value> <Style TargetType="toolkit:RatingItem"> <Setter Property="Background" Value="#fff" /> <Setter Property="BorderBrush" Value="#666" /> <Setter Property="BorderThickness" Value="1" /> </Style> </Setter.Value> </Setter> </Style> </toolkit:Rating.Style> </toolkit:Rating>

 

 

posted @ 2014-02-12 10:23  路就在脚下  Views(216)  Comments(1)    收藏  举报