Interface IInputElement
Defines input-related functionality for a control.
[NotClientImplementable]
public interface IInputElement
- Extension Methods
Properties
Cursor
Gets or sets the associated mouse cursor.
Cursor? Cursor { get; }
Property Value
Focusable
Gets or sets a value indicating whether the control can receive keyboard focus.
bool Focusable { get; }
Property Value
IsEffectivelyEnabled
Gets a value indicating whether this control and all its parents are enabled.
bool IsEffectivelyEnabled { get; }
Property Value
Remarks
The IsEnabled property is used to toggle the enabled state for individual controls. The IsEffectivelyEnabled property takes into account the IsEnabled value of this control and its parent controls.
IsEffectivelyVisible
Gets a value indicating whether this control and all its parents are visible.
bool IsEffectivelyVisible { get; }
Property Value
IsEnabled
Gets or sets a value indicating whether the control is enabled for user interaction.
bool IsEnabled { get; }
Property Value
IsFocused
Gets a value indicating whether the control is focused.
bool IsFocused { get; }
Property Value
IsHitTestVisible
Gets a value indicating whether the control is considered for hit testing.
bool IsHitTestVisible { get; }
Property Value
IsKeyboardFocusWithin
Gets a value indicating whether keyboard focus is anywhere within the element or its visual tree child elements.
bool IsKeyboardFocusWithin { get; }
Property Value
IsPointerOver
Gets a value indicating whether the pointer is currently over the control.
bool IsPointerOver { get; }
Property Value
KeyBindings
Gets the key bindings for the element.
List<KeyBinding> KeyBindings { get; }
Property Value
Methods
AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool)
Adds a handler for the specified routed event.
void AddHandler(RoutedEvent routedEvent, Delegate handler, RoutingStrategies routes = RoutingStrategies.Direct | RoutingStrategies.Bubble, bool handledEventsToo = false)
Parameters
routedEvent
RoutedEventThe routed event.
handler
DelegateThe handler.
routes
RoutingStrategiesThe routing strategies to listen to.
handledEventsToo
boolWhether handled events should also be listened for.
Focus(NavigationMethod, KeyModifiers)
Focuses the control.
bool Focus(NavigationMethod method = NavigationMethod.Unspecified, KeyModifiers keyModifiers = KeyModifiers.None)
Parameters
method
NavigationMethodThe method by which focus was changed.
keyModifiers
KeyModifiersAny key modifiers active at the time of focus.
Returns
RaiseEvent(RoutedEventArgs)
Raises a routed event.
void RaiseEvent(RoutedEventArgs e)
Parameters
e
RoutedEventArgsThe event args.
RemoveHandler(RoutedEvent, Delegate)
Removes a handler for the specified routed event.
void RemoveHandler(RoutedEvent routedEvent, Delegate handler)
Parameters
routedEvent
RoutedEventThe routed event.
handler
DelegateThe handler.
Events
GotFocus
Occurs when the control receives focus.
event EventHandler<GotFocusEventArgs>? GotFocus
Event Type
KeyDown
Occurs when a key is pressed while the control has focus.
event EventHandler<KeyEventArgs>? KeyDown
Event Type
KeyUp
Occurs when a key is released while the control has focus.
event EventHandler<KeyEventArgs>? KeyUp
Event Type
LostFocus
Occurs when the control loses focus.
event EventHandler<RoutedEventArgs>? LostFocus
Event Type
PointerEntered
Occurs when the pointer enters the control.
event EventHandler<PointerEventArgs>? PointerEntered
Event Type
PointerExited
Occurs when the pointer leaves the control.
event EventHandler<PointerEventArgs>? PointerExited
Event Type
PointerMoved
Occurs when the pointer moves over the control.
event EventHandler<PointerEventArgs>? PointerMoved
Event Type
PointerPressed
Occurs when the pointer is pressed over the control.
event EventHandler<PointerPressedEventArgs>? PointerPressed
Event Type
PointerReleased
Occurs when the pointer is released over the control.
event EventHandler<PointerReleasedEventArgs>? PointerReleased
Event Type
PointerWheelChanged
Occurs when the mouse wheel is scrolled over the control.
event EventHandler<PointerWheelEventArgs>? PointerWheelChanged
Event Type
TextInput
Occurs when a user typed some text while the control has focus.
event EventHandler<TextInputEventArgs>? TextInput