Border.Background Border.Background Border.Background Border.Background Property

Definition

Ruft den Brush ab, der den Bereich zwischen den Grenzen einer Border ausfüllt, oder legt diesen fest.Gets or sets the Brush that fills the area between the bounds of a Border.

public:
 property System::Windows::Media::Brush ^ Background { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush Background { get; set; }
member this.Background : System.Windows.Media.Brush with get, set
Public Property Background As Brush

Eigenschaftswert

Der Brush, der den Hintergrund zeichnet.The Brush that draws the background. Diese Eigenschaft hat keinen Standardwert.This property has no default value.

Beispiele

Im folgenden Beispiel wird gezeigt, wie der Wert der Background -Eigenschaft mithilfe Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) von und Code festgelegt wird.The following example shows how to set the value of the Background property by using Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) and code.

myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
myBorder1.BorderThickness = new Thickness(5, 10, 15, 20);
myBorder1.Background = Brushes.AliceBlue;
myBorder1.Padding = new Thickness(5);
myBorder1.CornerRadius = new CornerRadius(15);
Dim myBorder1 As New Border()
myBorder1.BorderBrush = Brushes.SlateBlue
myBorder1.BorderThickness = New Thickness(5, 10, 15, 20)
myBorder1.Background = Brushes.AliceBlue
myBorder1.Padding = New Thickness(5)
myBorder1.CornerRadius = New CornerRadius(15)
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

Hinweise

Informationen zur AbhängigkeitseigenschaftDependency Property Information

BezeichnerfeldIdentifier field BackgroundProperty
Metadateneigenschaften auf true festgelegtMetadata properties set to true AffectsRender, SubPropertiesDoNotAffectRenderAffectsRender, SubPropertiesDoNotAffectRender

Gilt für: