Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 2.56 KB

border_background.md

File metadata and controls

49 lines (34 loc) · 2.56 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.Border.Background
winrt property

Windows.UI.Xaml.Controls.Border.Background

-description

Gets or sets the Brush that fills the background (inner area) of the border.

-xaml-syntax

<Border Background="{StaticResource resourceName}"/>
- or -
<Border Background="colorString"/>
- or -
<Border>
  <Border.Background>singleBrush</Border.Background>
</Border>

-xaml-values

resourceName
resourceNameThe resource name (x:Key attribute value) of an existing XAML resource that defines a brush. This is the recommended way to specify Brush values in XAML if you have any intention of using the same colors or brushes in more than one part of your UI. See Remarks in Brush or ResourceDictionary and XAML resource references.
colorString
colorStringThe 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.
singleBrush
singleBrushWithin opening and closing property elements, exactly one object element for an object that derives from Brush. This is typically one of the following classes: LinearGradientBrush, ImageBrush, SolidColorBrush.
## -property-value The brush that fills the background. The default is **null**, (a null brush) which is evaluated as [Transparent](../windows.ui/colors_transparent.md) for rendering.

-remarks

The Background value for a Border is visible underneath the inner area if the element that is the Child element has transparency or null value brushes for any of its defining area. It is also visible between the border edge and the Child content if nonzero values are applied for a Padding value.

-examples

The following example shows how to set the background of a Border to a solid color using an inline-defined attribute value "Cyan". The XAML parser uses this "Cyan" value to refer to the named color Colors.Cyan, and to create the SolidColorBrush instance that supplies the runtime value.

[!code-xamlBackgroundCorner]

-see-also

Child, Use brushes