ContentPresenter.Background Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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).