wp8 toolkit:rating剖析

原文参考自:http://social.msdn.microsoft.com/Forums/zh-CN/6f3aef4d-c99f-4100-a345-94c9b7e0bfba/how-to-change-the-star-color-of-microsoftphonecontrolsrating-control

这是wp8的一个评分用的控件,用的不多,资料也很少,心得如下:

一、首先这个控件的外观是不能改变的,★(五角星)没法换成三角或者别的图片.(如果必须改,只能修改toolkit源码,写这篇文章为止还没有找到解决的别的方法)

二、其次说里面布局.

<toolkit:Rating Width="250" Height="50" x:Name="RatingControl" RatingItemCount="5" Value="2">
<!--FilledItemStyle的style-->
  <toolkit:Rating.FilledItemStyle>
    <Style TargetType="toolkit:RatingItem">
      <Setter Property="Background">
      <Setter.Value >
      <RadialGradientBrush Center="0.548,0.475" GradientOrigin="0.484,0.537">
      <GradientStop Color="#FFB10000" Offset="1"/>
      <GradientStop Color="#FFF70000"/>
      <GradientStop Color="#FFFFFF35" Offset="0.043"/>
      </RadialGradientBrush>
      </Setter.Value>
      </Setter>
    </Style>
  </toolkit:Rating.FilledItemStyle>
<!--UnfilledItemStyle的style-->
  <toolkit:Rating.UnfilledItemStyle>
    <Style TargetType="toolkit:RatingItem">
      <Setter Property="Background" Value="Green" />
    </Style>
  </toolkit:Rating.UnfilledItemStyle>
</toolkit:Rating>

posted on 2013-09-27 16:36  鸣动我心  阅读(303)  评论(0)    收藏  举报