本篇主讲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>
原文:http://www.cnblogs.com/lengxuanfei/p/3545476.html