用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>
首先在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>
相关文章推荐
- Blend设计全局样式
- QScrollBar样式设计
- Silverlight & Blend动画设计系列文章
- 响应式布局(css,js,php等方法),根据媒体类型设计不同的样式,css在线手册
- php大力力 [031节] php设计系统后台菜单和样式设计
- Silverlight & Blend动画设计系列八:拖放(Drag-Drop)操作与拖放行为(DragBehavior)
- 滚动条样式设计IE支持
- 设计中默认样式的强大威力
- 【转帖】标准化设计解决方案 - 标记语言和样式手册 (Web Standards Solutions The Markup and Style Handbook)
- 通通玩blend美工(5)——旋转木马,交互性设计
- CSS基础之——设计文本样式(2)
- Spinner下拉框使用方式总结(样式设计)
- Blend设计VSM
- CSS设计表格(上)--样式设计及全选功能
- Silverlight & Blend动画设计系列九:动画(Animation)与视图状态管理(Visual State Manager)
- 如何设计firemonkey的style样式
- JS图片素材及JQueryUI样式设计
- Silverlight & Blend动画设计系列一:偏移动画(TranslateTransform)
- 使用Blend设计出符合效果的WPF界面
- Silverlight & Blend动画设计系列十二:三角函数(Trigonometry)动画之自由旋转