EventSetter.Handler Vlastnost

Definice

Získá nebo nastaví odkaz na obslužnou rutinu pro směrovanou událost v setteru.

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

Hodnota vlastnosti

Delegate

Odkaz na obslužnou rutinu, která je připojena tímto EventSetter.

Atributy

Příklady

Následující příklad nastaví Handler vlastnost jako součást EventSetter stylu revize.

<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>

Platí pro

Viz také