-api-id | -api-type |
---|---|
P:Windows.UI.Xaml.Controls.ItemsControl.ItemsSource |
winrt property |
Gets or sets an object source used to generate the content of the ItemsControl.
<itemsControl ItemsSource="bindingDeclaration"/>
-or-
<itemsControl ItemsSource="resourceReferenceToSource"/>
- bindingDeclaration
- bindingDeclarationA Binding declaration using a {Binding ....} markup extension. For more information, see {Binding} markup extension.
- resourceReferenceToSource
- resourceReferenceToSourceA resource reference to an existing iterable/enumerable items source from a resources collection. The resource reference must specify the desired items source by key.
The object that is used to generate the content of the ItemsControl. The default is null
.
The type of the object that you set the ItemsSource property to must implement one of these interfaces.
.NET | C++/WinRT | C++/CX |
---|---|---|
IEnumerable<Object> | IIterable<IInspectable> | IIterable<Object^> |
IEnumerable | IBindableIterable | IBindableIterable |
The ItemsControl can provide better performance if the ItemsSource property value also implements a random-access list interface.
The ItemsControl can raise collection-changed notification events if the ItemsSource property value also implements a collection-changed notification interface.
.NET | C++/WinRT | C++/CX |
---|---|---|
INotifyCollectionChanged | INotifyCollectionChanged | INotifyCollectionChanged |
ObservableCollection<Object> | IObservableVector<IInspectable> | IObservableVector<Object^> |
For .NET, in order for the collection-changed events to be handled, the ItemsSource property must also implement the non-generic IList interface.