Expand Minimize

Control.Background property

Applies to Windows and Windows Phone

Gets or sets a brush that provides the background of the control.

Syntax


public Brush Background { get; set; }


<control>
  <control.Background>
    singleBrush
  </control.Background>
</control>


<control Background="colorString"/>

XAML Values

singleBrush

Within opening and closing property elements for control.Background, exactly one object element for an object that derives from Brush. The object element is typically one of these classes: LinearGradientBrush, ImageBrush, SolidColorBrush. The control placeholder is typically a name of the derived control you are using, for example Button.

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. See Color.

Property value

Type: Brush

The brush that provides the background of the control. The default is null (a null Brush, which evaluates as transparent).

Remarks

Each control might apply this property differently based on its visual template. This property only affects a control whose template uses the Background property as a parameter. On other controls, this property has no effect. For more info about visual templates, see the Template property.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Control

 

 

Show:
© 2014 Microsoft. All rights reserved.