Panel.Background Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
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
Valor de propiedad
Objeto Brush. El valor predeterminado es null.
Ejemplos
En el ejemplo siguiente se establece el Background de en Grid .RadialGradientBrush
<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>
Comentarios
Panellos elementos no reciben eventos de mouse o lápiz óptico si no se define .Background Si necesita controlar eventos de mouse o lápiz óptico, pero no desea un fondo para Panel, use Transparent.
Información sobre propiedades de dependencia
| Campo identificador | BackgroundProperty |
Propiedades de metadatos establecidas en true |
AffectsRender, SubPropertiesDoNotAffectRender |