ContentPresenter.Foreground 屬性

定義

取得或設定 Brush ,以套用至 ContentPresenter所處理的文字內容。

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 筆刷,但系統樣式預設會針對色主題) 將此設定為黑色 (或深色主題的白色 () 。

適用於

另請參閱