ContentPresenter.Foreground 属性

定义

获取或设置要应用于 ContentPresenter 处理的文本内容的 Brush

public:
 property Brush ^ Foreground { Brush ^ get(); void set(Brush ^ value); };
Brush Foreground();

void Foreground(Brush value);
public Brush Foreground { get; set; }
var brush = contentPresenter.foreground;
contentPresenter.foreground = brush;
Public Property Foreground As Brush
<ContentPresenter Foreground="{StaticResource resourceName}"/>
- or -
<ContentPresenter Foreground="colorString"/>
- or -
<ContentPresenter>
  <ContentPresenter.Foreground>singleBrush</ContentPresenter.Foreground>
</ContentPresenter>

属性值

用作文本内容的前景画笔的画笔。 从纯代码的角度来看,默认值为 null 画笔,但系统样式默认设置为浅主题) 黑色 (,将深色主题) 设置为白色 (。

适用于

另请参阅