Windows Dev Center

Border.Background Property

Gets or sets the Brush that fills the background of the border.

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

public Brush Background { get; set; }
<Border Background="colorString"/>

XAML Values


Within opening and closing property elements for Border.Background, exactly one object element for an object that derives from Brush. This is typically one of the following classes: LinearGradientBrush, RadialGradientBrush, ImageBrush, SolidColorBrush, VideoBrush.


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. See the XAML Values section in Color.

Property Value

Type: System.Windows.Media.Brush
The brush that fills the background.

Dependency property identifier field: BackgroundProperty

The following example shows how to set the background of a Border.

<Border Background="Cyan" CornerRadius="20" Grid.Column="2" Grid.Row="2">
    <TextBlock Text="Background Brush" TextWrapping="Wrap" VerticalAlignment="Center" />

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2015 Microsoft