Table of Contents

Interface ISelectionAdapter

Namespace
Avalonia.Controls.Utils
Assembly
Avalonia.Controls.dll

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

public interface ISelectionAdapter

Properties

ItemsSource

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

IEnumerable? ItemsSource { get; set; }

Property Value

IEnumerable

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

SelectedItem

Gets or sets the selected item.

object? SelectedItem { get; set; }

Property Value

object

The currently selected item.

Methods

HandleKeyDown(KeyEventArgs)

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

void HandleKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

A KeyEventArgs that contains data about the KeyDown event.

Events

Cancel

Occurs when a selection has been canceled.

event EventHandler<RoutedEventArgs>? Cancel

Event Type

EventHandler<RoutedEventArgs>

Commit

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

event EventHandler<RoutedEventArgs>? Commit

Event Type

EventHandler<RoutedEventArgs>

SelectionChanged

Occurs when the SelectedItem property value changes.

event EventHandler<SelectionChangedEventArgs>? SelectionChanged

Event Type

EventHandler<SelectionChangedEventArgs>