Skip to main content

ISelectionAdapter Interface

Definition

Assembly:Avalonia.Controls
Package:Avalonia

Defines an item collection, selection members, and key handling for the selection adapter contained in the drop-down portion of an Avalonia.Controls.AutoCompleteBox control.

public interface ISelectionAdapter

Methods

NameDescription
HandleKeyDownProvides handling for the Avalonia.Input.InputElement.KeyDown event that occurs when a key is pressed while the drop-down portion of the Avalonia.Controls.AutoCompleteBox has focus.

HandleKeyDown Method

Provides handling for the Avalonia.Input.InputElement.KeyDown event that occurs when a key is pressed while the drop-down portion of the Avalonia.Controls.AutoCompleteBox has focus.

public void HandleKeyDown(Avalonia.Input.KeyEventArgs e)

Parameters

e Avalonia.Input.KeyEventArgs

A Avalonia.Input.KeyEventArgs that contains data about the Avalonia.Input.InputElement.KeyDown event.

Properties

NameDescription
ItemsSourceGets or sets a collection that is used to generate content for the selection adapter.
SelectedItemGets or sets the selected item.

ItemsSource Property

Gets or sets a collection that is used to generate content for the selection adapter.

public System.Collections.IEnumerable ItemsSource { get; set; }

Value

The collection that is used to generate content for the selection adapter.

SelectedItem Property

Gets or sets the selected item.

public object SelectedItem { get; set; }

Value

The currently selected item.

Events

NameDescription
CancelOccurs when a selection has been canceled.
CommitOccurs when a selected item is not cancelled and is committed as the selected item.
SelectionChangedOccurs when the Avalonia.Controls.Utils.ISelectionAdapter.SelectedItem property value changes.

Cancel Event

Occurs when a selection has been canceled.

public event EventHandler<Avalonia.Interactivity.RoutedEventArgs> Cancel

Commit Event

Occurs when a selected item is not cancelled and is committed as the selected item.

public event EventHandler<Avalonia.Interactivity.RoutedEventArgs> Commit

SelectionChanged Event

Occurs when the Avalonia.Controls.Utils.ISelectionAdapter.SelectedItem property value changes.

public event EventHandler<Avalonia.Controls.SelectionChangedEventArgs> SelectionChanged