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