Share via


ContentPresenter.Background 屬性

定義

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

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

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

屬性值

做為內容背景筆刷的筆刷。 默認值是純程式代碼檢視方塊中的 Null 筆刷,但系統樣式會將它設定為淺色主題的白色 () 或深色主題的黑色 () 。

適用於