Skip to content

UIElementMarkupExtensions.OnKeyDown<T> method

Subscribes handler to KeyDown. Occurs when a key is pressed while the element has focus; marking it handled also drops the text input the keystroke would produce.

public static T OnKeyDown<T>(this T target, Action<KeyEventArgs> handler)
where T : UIElement
parameter description
T Receiver type.
target Target UIElement.
handler Handler subscribed to KeyDown.

The same element for chaining.

Sets: UIElement.KeyDown