简体   繁体   English

TextBlock.Foreground的默认颜色是什么?

[英]What is default color of TextBlock.Foreground?

Is default value of TextBlock's Foreground one of the SystemColors? TextBlock的Foreground是SystemColors的默认值吗? If so, which one is it? 如果是这样,那是哪一个?

This is rather theme-dependent, if there is no override from the applying theme the DP-system uses the default value of the respective DependencyProperty , which is Brushes.Black . 这与主题相关,如果应用主题没有覆盖,则DP系统使用相应DependencyProperty的默认值,即Brushes.Black

There are however many possibly overrides, in the Aero theme inheritance changes the value in some cases. 但是有很多可能的覆盖,在Aero主题中,继承会在某些情况下更改值。 While the TextBlock style does not set the Foreground directly (which would be a stronger override), the Foreground of Windows is set to {DynamicResource {x:Static SystemColors.WindowTextBrushKey}} so if the TextBlock is in a Window the brush associated with that key will be applied unless the inheritance is overridden by another value of even higher precedence . 虽然TextBlock样式不直接设置Foreground (这将是一个更强的覆盖),但WindowsForeground设置为{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}因此如果TextBlockWindow中与之关联的画笔除非继承被更高优先级的另一个值覆盖,否则将应用密钥。

Textblock的前景十六进制值为#FF000000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM