膨胀机着色

时间:2016-03-05 10:29:14

标签: c# templates silverlight listbox expander

我有一个扩展器,其中包含:扩展器标头和列表框。
我想创建以下情况。

一个。当悬停在扩展器头上时 - 将其头部背景颜色为蓝色 湾当悬停在扩展器上时#& 列表框项将其涂成灰色。
C。当扩展器'列表框项目被选中我希望发生两件事:

  1. 列表框项目背景以灰色显示
  2. 扩展器'标题背景用蓝色着色。
  3. 我的问题是如何使用silverlight。

    非常感谢你们:)

1 个答案:

答案 0 :(得分:0)

我猜Expander控件有一个Background属性,它通过TemplateBinding绑定到它的嵌入边框控件:

<Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                        <Grid>
                            <Grid.ColumnDefinitions>
                             ...

尝试通过将以下行添加到扩展器样式来更改扩展器控件的相应Background属性。

<Setter Property="Background" Value="#000000"></Setter>

像这样你也可以改变listbox control背景属性。

相关问题