EventSetter.Handler Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the reference to a handler for a routed event in the setter.
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
Property Value
Reference to the handler that is attached by this EventSetter.
- Attributes
Examples
The following example sets the Handler property as part of a EventSetter in a markup style.
<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>
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET