ContentPresenter.Background Property

Definition

Gets or sets the Brush to apply to the background of content handled by the 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>

Property Value

The brush used as the background brush for the contents. The default is a null brush from a pure code perspective, but system style defaults set this to White (for Light theme) or Black (for Dark theme).

Applies to