EventSetter.Handler Property

Gets or sets the reference to a handler for a routed event in the setter.

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public Delegate Handler { get; set; }
/** @property */
public Delegate get_Handler ()

/** @property */
public void set_Handler (Delegate value)

public function get Handler () : Delegate

public function set Handler (value : Delegate)

For XAML information, see the Delegate type.

Property Value

Reference to the handler that is attached by this EventSetter.

The following example sets the Handler property as part of a EventSetter in a markup style.

    <Style TargetType="{x:Type Button}">
      <EventSetter Event="Click" Handler="b1SetColor"/>
  <Button>Click me</Button>
  <Button Name="ThisButton" Click="HandleThis">Raise event, handle it, use handled=true handler to get it anyways</Button>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions