ItemsControlItemsSource Property
Gets or sets a collection used to generate the content of the
ItemsControl.
Namespace: Avalonia.ControlsAssembly: Avalonia.Controls (in Avalonia.Controls.dll) Version: 11.3.999
public IEnumerable? ItemsSource { get; set; }
Public Property ItemsSource As IEnumerable
Get
Set
member ItemsSource : IEnumerable with get, set
Property Value
IEnumerable
A common scenario is to use an
ItemsControl such as a
ListBox to display a data collection, or to bind an
ItemsControl to a collection object. To bind an
ItemsControl
to a collection object, use the
ItemsSource property.
When the
ItemsSource property is set, the
Items collection
is made read-only and fixed-size.
When
ItemsSource is in use, setting the property to null removes the
collection and restores usage to
Items, which will be an empty
ItemCollection.