在Metro主题中覆盖ContentPresenter的TextBlock样式

时间:2015-08-13 08:05:24

标签: c# wpf xaml styles

我在项目中使用了metro主题。

我有TextBlock Base的样式。

<Style x:Key="TextBlockText" TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="#FF63798F"/>
    <Setter Property="FontSize" Value="14"/>
    <Setter Property="VerticalAlignment" Value="Bottom"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>

我想通过为它设置样式来更改GridViewColumnHeader的前景。我为TextBlock.Foreground="White"添加了ContentPresenter。但它不会改变颜色!

当我删除TextBlock样式时,它没问题。

1 个答案:

答案 0 :(得分:0)

  1. 删除Foreground

  2. TextBlockText属性
  3. Windows

    添加样式

      
      

  4. 为ContentPresenter添加TextBlock.Foreground='White'

相关问题