IInputElement Interface

Summary

Defines input-related functionality for a control.
Namespace
Avalonia.Input
Interfaces
Implementing Types
graph TD Interface0["IInteractive"]-.->Type click Interface0 "/api/Avalonia.Interactivity/IInteractive" Interface1["IVisual"]-.->Type click Interface1 "/api/Avalonia.VisualTree/IVisual" Type["IInputElement"] class Type type-node Type-.->Implementing0["ReactiveWindow<TViewModel>"] click Implementing0 "/api/Avalonia/ReactiveWindow_1" Type-.->Implementing1["TabStrip"] click Implementing1 "/api/Avalonia.Controls.Primitives/TabStrip" Type-.->Implementing2["RangeBase"] click Implementing2 "/api/Avalonia.Controls.Primitives/RangeBase" Type-.->Implementing3["Panel"] click Implementing3 "/api/Avalonia.Controls/Panel" Type-.->Implementing4["ReactiveUserControl<TViewModel>"] click Implementing4 "/api/Avalonia/ReactiveUserControl_1" Type-.->Implementing5["IContentControl"] click Implementing5 "/api/Avalonia.Controls/IContentControl" Type-.->Implementing6["ItemsPresenter"] click Implementing6 "/api/Avalonia.Controls.Presenters/ItemsPresenter" Type-.->Implementing7["DataGridCellsPresenter"] click Implementing7 "/api/Avalonia.Controls.Primitives/DataGridCellsPresenter" Type-.->Implementing8["UserControl"] click Implementing8 "/api/Avalonia.Controls/UserControl" Type-.->Implementing9["RemoteWidget"] click Implementing9 "/api/Avalonia.Controls.Remote/RemoteWidget" Type-.->Implementing10["Border"] click Implementing10 "/api/Avalonia.Controls/Border" Type-.->Implementing11["DevTools"] click Implementing11 "/api/Avalonia.Diagnostics/DevTools" Type-.->Implementing12["IInputRoot"] click Implementing12 "/api/Avalonia.Input/IInputRoot" Type-.->Implementing13["TreeView"] click Implementing13 "/api/Avalonia.Controls/TreeView" Type-.->Implementing14["TabStripItem"] click Implementing14 "/api/Avalonia.Controls.Primitives/TabStripItem" Type-.->Implementing15["ProgressBar"] click Implementing15 "/api/Avalonia.Controls/ProgressBar" Type-.->Implementing16["DataGridRowsPresenter"] click Implementing16 "/api/Avalonia.Controls.Primitives/DataGridRowsPresenter" Type-.->Implementing17["ToggleButton"] click Implementing17 "/api/Avalonia.Controls.Primitives/ToggleButton" Type-.->Implementing18["IPresenter"] click Implementing18 "/api/Avalonia.Controls.Presenters/IPresenter" Type-.->Implementing19["DataGridRowGroupHeader"] click Implementing19 "/api/Avalonia.Controls/DataGridRowGroupHeader" Type-.->Implementing20["MenuItem"] click Implementing20 "/api/Avalonia.Controls/MenuItem" Type-.->Implementing21["WindowBase"] click Implementing21 "/api/Avalonia.Controls/WindowBase" Type-.->Implementing22["IPanel"] click Implementing22 "/api/Avalonia.Controls/IPanel" Type-.->Implementing23["Canvas"] click Implementing23 "/api/Avalonia.Controls/Canvas" Type-.->Implementing24["ScrollBar"] click Implementing24 "/api/Avalonia.Controls.Primitives/ScrollBar" Type-.->Implementing25["CalendarDayButton"] click Implementing25 "/api/Avalonia.Controls.Primitives/CalendarDayButton" Type-.->Implementing26["ContentPresenter"] click Implementing26 "/api/Avalonia.Controls.Presenters/ContentPresenter" Type-.->Implementing27["Separator"] click Implementing27 "/api/Avalonia.Controls/Separator" Type-.->Implementing28["ContentControl"] click Implementing28 "/api/Avalonia.Controls/ContentControl" Type-.->Implementing29["Track"] click Implementing29 "/api/Avalonia.Controls.Primitives/Track" Type-.->Implementing30["TextBox"] click Implementing30 "/api/Avalonia.Controls/TextBox" Type-.->Implementing31["DropDown"] click Implementing31 "/api/Avalonia.Controls/DropDown" Type-.->Implementing32["DataValidationErrors"] click Implementing32 "/api/Avalonia.Controls/DataValidationErrors" Type-.->Implementing33["SimpleGrid"] click Implementing33 "/api/Avalonia.Diagnostics.Views/SimpleGrid" Type-.->Implementing34["Carousel"] click Implementing34 "/api/Avalonia.Controls/Carousel" Type-.->Implementing35["PopupRoot"] click Implementing35 "/api/Avalonia.Controls.Primitives/PopupRoot" Type-.->Implementing36["Decorator"] click Implementing36 "/api/Avalonia.Controls/Decorator" Type-.->Implementing37["DataGridDetailsPresenter"] click Implementing37 "/api/Avalonia.Controls.Primitives/DataGridDetailsPresenter" Type-.->Implementing38["IContentPresenter"] click Implementing38 "/api/Avalonia.Controls.Presenters/IContentPresenter" Type-.->Implementing39["Thumb"] click Implementing39 "/api/Avalonia.Controls.Primitives/Thumb" Type-.->Implementing40["EventsView"] click Implementing40 "/api/Avalonia.Diagnostics.Views/EventsView" Type-.->Implementing41["NumericUpDown"] click Implementing41 "/api/Avalonia.Controls/NumericUpDown" Type-.->Implementing42["DatePicker"] click Implementing42 "/api/Avalonia.Controls/DatePicker" Type-.->Implementing43["TextBlock"] click Implementing43 "/api/Avalonia.Controls/TextBlock" Type-.->Implementing44["Grid"] click Implementing44 "/api/Avalonia.Controls/Grid" Type-.->Implementing45["ComboBoxItem"] click Implementing45 "/api/Avalonia.Controls/ComboBoxItem" Type-.->Implementing46["Ellipse"] click Implementing46 "/api/Avalonia.Controls.Shapes/Ellipse" Type-.->Implementing47["ContextMenu"] click Implementing47 "/api/Avalonia.Controls/ContextMenu" Type-.->Implementing48["ScrollContentPresenter"] click Implementing48 "/api/Avalonia.Controls.Presenters/ScrollContentPresenter" Type-.->Implementing49["DockPanel"] click Implementing49 "/api/Avalonia.Controls/DockPanel" Type-.->Implementing50["TabControl"] click Implementing50 "/api/Avalonia.Controls/TabControl" Type-.->Implementing51["VirtualizingStackPanel"] click Implementing51 "/api/Avalonia.Controls/VirtualizingStackPanel" Type-.->Implementing52["WrapPanel"] click Implementing52 "/api/Avalonia.Controls/WrapPanel" Type-.->Implementing53["InputElement"] click Implementing53 "/api/Avalonia.Input/InputElement" Type-.->Implementing54["StackPanel"] click Implementing54 "/api/Avalonia.Controls/StackPanel" Type-.->Implementing55["HeaderedItemsControl"] click Implementing55 "/api/Avalonia.Controls.Primitives/HeaderedItemsControl" Type-.->Implementing56["CheckBox"] click Implementing56 "/api/Avalonia.Controls/CheckBox" Type-.->Implementing57["ListBoxItem"] click Implementing57 "/api/Avalonia.Controls/ListBoxItem" Type-.->Implementing58["TreePageView"] click Implementing58 "/api/Avalonia.Diagnostics.Views/TreePageView" Type-.->Implementing59["Menu"] click Implementing59 "/api/Avalonia.Controls/Menu" Type-.->Implementing60["RepeatButton"] click Implementing60 "/api/Avalonia.Controls/RepeatButton" Type-.->Implementing61["GridSplitter"] click Implementing61 "/api/Avalonia.Controls/GridSplitter" Type-.->Implementing62["AdornerDecorator"] click Implementing62 "/api/Avalonia.Controls.Primitives/AdornerDecorator" Type-.->Implementing63["ToolTip"] click Implementing63 "/api/Avalonia.Controls/ToolTip" Type-.->Implementing64["RoutedViewHost"] click Implementing64 "/api/Avalonia/RoutedViewHost" Type-.->Implementing65["Polygon"] click Implementing65 "/api/Avalonia.Controls.Shapes/Polygon" Type-.->Implementing66["LayoutTransformControl"] click Implementing66 "/api/Avalonia.Controls/LayoutTransformControl" Type-.->Implementing67["Expander"] click Implementing67 "/api/Avalonia.Controls/Expander" Type-.->Implementing68["SelectingItemsControl"] click Implementing68 "/api/Avalonia.Controls.Primitives/SelectingItemsControl" Type-.->Implementing69["MenuBase"] click Implementing69 "/api/Avalonia.Controls/MenuBase" Type-.->Implementing70["Viewbox"] click Implementing70 "/api/Avalonia.Controls/Viewbox" Type-.->Implementing71["TreeViewItem"] click Implementing71 "/api/Avalonia.Controls/TreeViewItem" Type-.->Implementing72["IControl"] click Implementing72 "/api/Avalonia.Controls/IControl" Type-.->Implementing73["ItemsPresenterBase"] click Implementing73 "/api/Avalonia.Controls.Presenters/ItemsPresenterBase" Type-.->Implementing74["AutoCompleteBox"] click Implementing74 "/api/Avalonia.Controls/AutoCompleteBox" Type-.->Implementing75["Path"] click Implementing75 "/api/Avalonia.Controls.Shapes/Path" Type-.->Implementing76["DataGrid"] click Implementing76 "/api/Avalonia.Controls/DataGrid" Type-.->Implementing77["ItemsControl"] click Implementing77 "/api/Avalonia.Controls/ItemsControl" Type-.->Implementing78["Button"] click Implementing78 "/api/Avalonia.Controls/Button" Type-.->Implementing79["TextPresenter"] click Implementing79 "/api/Avalonia.Controls.Presenters/TextPresenter" Type-.->Implementing80["AutoCompleteBox.BindingEvaluator<T>"] click Implementing80 "/api/Avalonia.Controls/BindingEvaluator_1" Type-.->Implementing81["Window"] click Implementing81 "/api/Avalonia.Controls/Window" Type-.->Implementing82["ButtonSpinner"] click Implementing82 "/api/Avalonia.Controls/ButtonSpinner" Type-.->Implementing83["CalendarItem"] click Implementing83 "/api/Avalonia.Controls.Primitives/CalendarItem" Type-.->Implementing84["IMenu"] click Implementing84 "/api/Avalonia.Controls/IMenu" Type-.->Implementing85["DropDownItem"] click Implementing85 "/api/Avalonia.Controls/DropDownItem" Type-.->Implementing86["AccessText"] click Implementing86 "/api/Avalonia.Controls.Primitives/AccessText" Type-.->Implementing87["IMenuElement"] click Implementing87 "/api/Avalonia.Controls/IMenuElement" Type-.->Implementing88["UniformGrid"] click Implementing88 "/api/Avalonia.Controls.Primitives/UniformGrid" Type-.->Implementing89["CalendarButton"] click Implementing89 "/api/Avalonia.Controls.Primitives/CalendarButton" Type-.->Implementing90["ScrollViewer"] click Implementing90 "/api/Avalonia.Controls/ScrollViewer" Type-.->Implementing91["TopLevel"] click Implementing91 "/api/Avalonia.Controls/TopLevel" Type-.->Implementing92["DrawingPresenter"] click Implementing92 "/api/Avalonia.Controls/DrawingPresenter" Type-.->Implementing93["AdornerLayer"] click Implementing93 "/api/Avalonia.Controls.Primitives/AdornerLayer" Type-.->Implementing94["Spinner"] click Implementing94 "/api/Avalonia.Controls/Spinner" Type-.->Implementing95["DataGridRowHeader"] click Implementing95 "/api/Avalonia.Controls.Primitives/DataGridRowHeader" Type-.->Implementing96["HeaderedContentControl"] click Implementing96 "/api/Avalonia.Controls.Primitives/HeaderedContentControl" Type-.->Implementing97["Slider"] click Implementing97 "/api/Avalonia.Controls/Slider" Type-.->Implementing98["Calendar"] click Implementing98 "/api/Avalonia.Controls/Calendar" Type-.->Implementing99["DataGridColumnHeader"] click Implementing99 "/api/Avalonia.Controls/DataGridColumnHeader" Type-.->Implementing100["EmbeddableControlRoot"] click Implementing100 "/api/Avalonia.Controls.Embedding/EmbeddableControlRoot" Type-.->Implementing101["ListBox"] click Implementing101 "/api/Avalonia.Controls/ListBox" Type-.->Implementing102["DataGridRow"] click Implementing102 "/api/Avalonia.Controls/DataGridRow" Type-.->Implementing103["Polyline"] click Implementing103 "/api/Avalonia.Controls.Shapes/Polyline" Type-.->Implementing104["Rectangle"] click Implementing104 "/api/Avalonia.Controls.Shapes/Rectangle" Type-.->Implementing105["DataGridCell"] click Implementing105 "/api/Avalonia.Controls/DataGridCell" Type-.->Implementing106["Line"] click Implementing106 "/api/Avalonia.Controls.Shapes/Line" Type-.->Implementing107["IVirtualizingPanel"] click Implementing107 "/api/Avalonia.Controls/IVirtualizingPanel" Type-.->Implementing108["DataGridFrozenGrid"] click Implementing108 "/api/Avalonia.Controls.Primitives/DataGridFrozenGrid" Type-.->Implementing109["Shape"] click Implementing109 "/api/Avalonia.Controls.Shapes/Shape" Type-.->Implementing110["Image"] click Implementing110 "/api/Avalonia.Controls/Image" Type-.->Implementing111["Control"] click Implementing111 "/api/Avalonia.Controls/Control" Type-.->Implementing112["CarouselPresenter"] click Implementing112 "/api/Avalonia.Controls.Presenters/CarouselPresenter" Type-.->Implementing113["TabItem"] click Implementing113 "/api/Avalonia.Controls/TabItem" Type-.->Implementing114["HeaderedSelectingItemsControl"] click Implementing114 "/api/Avalonia.Controls.Primitives/HeaderedSelectingItemsControl" Type-.->Implementing115["ComboBox"] click Implementing115 "/api/Avalonia.Controls/ComboBox" Type-.->Implementing116["IItemsPresenter"] click Implementing116 "/api/Avalonia.Controls.Presenters/IItemsPresenter" Type-.->Implementing117["DataGridColumnHeadersPresenter"] click Implementing117 "/api/Avalonia.Controls.Primitives/DataGridColumnHeadersPresenter" Type-.->Implementing118["IMenuItem"] click Implementing118 "/api/Avalonia.Controls/IMenuItem" Type-.->Implementing119["TemplatedControl"] click Implementing119 "/api/Avalonia.Controls.Primitives/TemplatedControl" Type-.->Implementing120["Popup"] click Implementing120 "/api/Avalonia.Controls.Primitives/Popup" Type-.->Implementing121["RadioButton"] click Implementing121 "/api/Avalonia.Controls/RadioButton"

Syntax

public interface IInputElement : IInteractive, IVisual

Events

Name Type Summary
GotFocus EventHandler<GotFocusEventArgs>
Occurs when the control receives focus.
KeyDown EventHandler<KeyEventArgs>
Occurs when a key is pressed while the control has focus.
KeyUp EventHandler<KeyEventArgs>
Occurs when a key is released while the control has focus.
LostFocus EventHandler<RoutedEventArgs>
Occurs when the control loses focus.
PointerEnter EventHandler<PointerEventArgs>
Occurs when the pointer enters the control.
PointerLeave EventHandler<PointerEventArgs>
Occurs when the pointer leaves the control.
PointerMoved EventHandler<PointerEventArgs>
Occurs when the pointer moves over the control.
PointerPressed EventHandler<PointerPressedEventArgs>
Occurs when the pointer is pressed over the control.
PointerReleased EventHandler<PointerReleasedEventArgs>
Occurs when the pointer is released over the control.
PointerWheelChanged EventHandler<PointerWheelEventArgs>
Occurs when the mouse wheen is scrolled over the control.
TextInput EventHandler<TextInputEventArgs>
Occurs when a user typed some text while the control has focus.

Properties

Name Value Summary
Cursor Cursor
Gets or sets the associated mouse cursor.
Focusable bool
Gets or sets a value indicating whether the control can receive keyboard focus.
IsEnabled bool
Gets or sets a value indicating whether the control is enabled for user interaction.
IsEnabledCore bool
Gets a value indicating whether the control is effectively enabled for user interaction.
IsFocused bool
Gets a value indicating whether the control is focused.
IsHitTestVisible bool
Gets a value indicating whether the control is considered for hit testing.
IsPointerOver bool
Gets a value indicating whether the pointer is currently over the control.
KeyBindings List<KeyBinding>
Gets the key bindings for the element.

Methods

Name Value Summary
Focus() void
Focuses the control.

Extension Methods

Name Value Summary
CalculateDistanceFromAncestor(IVisual) int
Calculates the distance from a visual's IRenderRoot.
FindCommonVisualAncestor(IVisual) IVisual
Tries to get the first common ancestor of two visuals.
GetInputElementsAt(Point) IEnumerable<IInputElement>
Returns the active input elements at a point on an IInputElement.
GetObservable<TEventArgs>(RoutedEvent<TEventArgs>, RoutingStrategies, bool) IObservable<TEventArgs>
Gets an observable for a RoutedEvent<TEventArgs>.
GetSelfAndVisualAncestors() IEnumerable<IVisual>
Enumerates an IVisual and its ancestors in the visual tree.
GetSelfAndVisualDescendants() IEnumerable<IVisual>
Enumerates an IVisual and its descendants in the visual tree.
GetVisualAncestors() IEnumerable<IVisual>
Enumerates the ancestors of an IVisual in the visual tree.
GetVisualAt(Point) IVisual
Gets the first visual in the visual tree whose bounds contain a point.
GetVisualChildren() IEnumerable<IVisual>
Enumerates the children of an IVisual in the visual tree.
GetVisualDescendants() IEnumerable<IVisual>
Enumerates the descendants of an IVisual in the visual tree.
GetVisualParent() IVisual
Gets the visual parent of an IVisual.
GetVisualParent<T>() T
Gets the visual parent of an IVisual.
GetVisualRoot() IRenderRoot
Gets the root visual for an IVisual.
GetVisualsAt(Point) IEnumerable<IVisual>
Enumerates the visible visuals in the visual tree whose bounds contain a point.
GetVisualsAt(Point, Func<IVisual, bool>) IEnumerable<IVisual>
Enumerates the visuals in the visual tree whose bounds contain a point.
InputHitTest(Point) IInputElement
Returns the topmost active input element at a point on an IInputElement.
IsVisualAncestorOf(IVisual) bool
Tests whether an IVisual is an ancestor of another visual.
PointToClient(PixelPoint) Point
Converts a point from screen to client coordinates.
PointToScreen(Point) PixelPoint
Converts a point from client to screen coordinates.
TranslatePoint(Point, IVisual) Point
Translates a point relative to this visual to coordinates that are relative to the specified visual. The visual and relativeTo should be descendants of the same root window