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; }