ItemsControl.ItemsSource ItemsControl.ItemsSource ItemsControl.ItemsSource ItemsControl.ItemsSource Property

Definition

Gets or sets an object source used to generate the content of the ItemsControl.

public : Platform::Object ItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable ItemsSource();

void ItemsSource(winrt::Windows::Foundation::IInspectable itemssource);
public object ItemsSource { get; set; }
Public ReadWrite Property ItemsSource As object
<itemsControl ItemsSource="bindingDeclaration"/>
-or-
<itemsControl ItemsSource="resourceReferenceToSource"/>

Property Value

object object

The object that is used to generate the content of the ItemsControl. The default is null.

Remarks

The ItemsSource property value must implement either the IIterable<IInspectable> or IBindableIterable interface. For example, in a C# application, it must implement IEnumerable<Object> or IEnumerable.

The ItemsControl can provide better performance if the ItemsSource property value also implements a random-access list interface: IVector<IInspectable>, IVectorView<IInspectable>, IBindableVector, or IBindableVectorView. In C#, this means IList<Object>, IReadOnlyCollection<Object>, or IList.

The ItemsControl can respond to changes if the ItemsSource property value also implements a change notification interface: IObservableVector<IInspectable> or INotifyCollectionChanged.