【发布时间】:2009-10-02 01:51:16
【问题描述】:
我应该为这种风格的BasedOn 写什么?
<Style
x:Key="DataGrid_ColumnHeaderStyle"
TargetType="wt:DataGridColumnHeader"
BasedOn="??????????"> <!-- I want this to be a reference to the default style -->
<Setter
Property="BorderBrush"
Value="{StaticResource Media_RaisedBorderBrush}" />
<Setter
Property="Background"
Value="{StaticResource Media_RaisedBackgroundBrush}" />
<Setter
Property="Foreground"
Value="{StaticResource Media_RaisedForegroundBrush}" />
</Style>
我不想覆盖整个默认样式,我只想使用 setter 更改少数属性。
编辑:
我知道如何使用BasedOn,但我只是不知道我要建立自己的风格的风格的名称或在哪里找到它。默认/内置样式的名称是什么?
编辑 2:
好吧,我想这毕竟不是我需要的。我是否包含BasedOn="{StaticResource {x:Type wt:DataGridColumnHeader}}" 似乎没有任何区别。问题是仅设置BorderBrush、Background 和Foreground 会导致排序箭头消失。我不明白为什么会这样,因为排序箭头是在ControlTemplate 中定义的,我没有编辑/覆盖ControlTemplate。我的排序箭头在哪里? (我肯定启用了排序,单击列标题确实会导致数据排序......它只是不显示箭头。)
【问题讨论】:
标签: wpf xaml wpftoolkit styles