ItemsSource Property
Gets or sets a collection used to generate the content of the ItemsControl.
Definition
Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)
- C#
- VB
- F#
public IEnumerable? ItemsSource { get; set; }
Public Property ItemsSource As IEnumerable
Get
Set
member ItemsSource : IEnumerable with get, set
Property Value
IEnumerableRemarks
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.