Panel.Background Property

July 28, 2014

Gets or sets a Brush that is used to fill the panel.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public Brush Background { get; set; }
<panel>
  <panel.Background>
    singleBrush
  </panel.Background>
</panel>
<panel Background="colorString"/>

XAML Values

singleBrush

Within opening and closing property elements for object.Background, exactly one object element for an object that derives from Brush. The object element can be one of the following: LinearGradientBrush, RadialGradientBrush, ImageBrush, SolidColorBrush, or VideoBrush.

colorString

The Color for a SolidColorBrush expressed as an attribute string. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB may also specify alpha information.

Property Value

Type: System.Windows.Media.Brush
The brush used to fill the panel. The default is null.

Dependency property identifier field: BackgroundProperty

The Background property determines the background color of the Panel.

The Background property specifies a Brush for the object. A Brush can represent a solid color, a linear or radial gradient, an image, or an applied video brush.

Some brush types (SolidColorBrush) support a XAML attribute syntax, whereas other brush types (ImageBrush, LinearGradientBrush, RadialGradientBrush) support only an object element syntax. This is why two versions of XAML syntax are shown for this property.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft