EventSetter.Handler Propiedad

Definición

Obtiene o establece la referencia a un controlador para un evento enrutado del establecedor.

public:
 property Delegate ^ Handler { Delegate ^ get(); void set(Delegate ^ value); };
public Delegate Handler { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.EventSetterHandlerConverter))]
public Delegate Handler { get; set; }
member this.Handler : Delegate with get, set
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.EventSetterHandlerConverter))>]
member this.Handler : Delegate with get, set
Public Property Handler As Delegate

Valor de propiedad

Haga referencia al controlador que está asociado por este EventSetter.

Atributos

Ejemplos

En el ejemplo siguiente se establece la Handler propiedad como parte de en EventSetter un estilo de marcado.

<StackPanel
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.EventOvw2"
  Name="dpanel2"
  Initialized="PrimeHandledToo"
>
  <StackPanel.Resources>
    <Style TargetType="{x:Type Button}">
      <EventSetter Event="Click" Handler="b1SetColor"/>
    </Style>
  </StackPanel.Resources>
  <Button>Click me</Button>
  <Button Name="ThisButton" Click="HandleThis">
    Raise event, handle it, use handled=true handler to get it anyway.
  </Button>
</StackPanel>

Se aplica a

Consulte también