Panel.Background Vlastnost

Definice

Získá nebo nastaví, Brush který se používá k vyplnění oblasti mezi ohraničení .Panel

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

Hodnota vlastnosti

Úloha Brush. Tato výchozí hodnota je null.

Příklady

Následující příklad nastaví Background vlastnost z na GridRadialGradientBrush.

<Grid>
  <Grid.Background>
    <RadialGradientBrush 
        GradientOrigin="0.5,0.5" 
        Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
      <RadialGradientBrush.GradientStops>
        <GradientStop Color="Yellow" Offset="0" />
        <GradientStop Color="Red" Offset="0.25" />
        <GradientStop Color="Blue" Offset="0.75" />
        <GradientStop Color="Green" Offset="1" />
      </RadialGradientBrush.GradientStops>
    </RadialGradientBrush>
  </Grid.Background>
</Grid>

Poznámky

Panel elementy nepřijímejte události myši nebo pera, pokud Background není definován. Pokud potřebujete zpracovat události myši nebo pera, ale nechcete mít pozadí pro , Panelpoužijte Transparent.

Informace o vlastnosti závislosti

Pole Identifikátor BackgroundProperty
Vlastnosti metadat nastavené na true AffectsRender, SubPropertiesDoNotAffectRender

Platí pro

Viz také