WPF - Styles can assign global EventHandlers to a control type
Always wanted to assign a specific EventHandler to all controls of one type?
It's very easy now. Styles offer EventSetter allowing you to assign EventHandlers to a specific Control or a Type of controls.
It's very easy now. Styles offer EventSetter allowing you to assign EventHandlers to a specific Control or a Type of controls.
<Style TargetType="{x:Type Button}">
<EventSetter Event="MouseDoubleClick" Handler="DoSomething" />
</Style>
Comments