语言

ContentPresenter.Background 属性

定义

获取或设置要应用于 ContentPresenter 处理的内容背景的 Brush。

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 画笔,但系统样式默认设置为 白色 (对于 浅 色主题)或 黑色 (对于 深色 主题)。

适用于