您的位置:首页 > Web前端 > CSS

用Blend设计样式

2014-01-13 13:40 246 查看
在ListBox中怎样修改,选中项的背景色。

首先在Blend中拖入一个ListBox控件,

在对象和时间线中选择拖入的控件,右键点击选择编辑其他,选择编辑副本。

在状态中选择selected在属性里面可以修改我们想要的背景色,然后可以查看源,这个时候我们就可以手动修改想要的值。

<VisualState x:Name="Selected">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerGrid">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxItemSelectedBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxItemSelectedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: