Skip to main content

ItemTemplate Property

Gets or sets the DataTemplate used to display each item in the drop-down portion of the control.

Definition​

Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public IDataTemplate ItemTemplate { get; set; }

Property Value​

IDataTemplate
The DataTemplate used to display each item in the drop-down. The default is null.

Remarks​

You use the ItemTemplate property to specify the visualization of the data objects in the drop-down portion of the AutoCompleteBox control. If your AutoCompleteBox is bound to a collection and you do not provide specific display instructions by using a DataTemplate, the resulting UI of each item is a string representation of each object in the underlying collection.

See Also​

Reference​

AutoCompleteBox Class
Avalonia.Controls Namespace