ItemsSource Property

ItemsControl.ItemsSource Property


Gets or sets a collection used to generate the content of the ItemsControl.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public IEnumerable ItemsSource { get; set; }

Property Value

Type: System.Collections.IEnumerable

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

Content Model: This property may be used to add items to an ItemsControl.

A common scenario is to use an ItemsControl such as a ListBox, ListView, or TreeView 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. Note that the ItemsSource property supports OneWay binding by default.

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. When ItemsSource is not in use, the value of this property is null, and setting it to null has no effect.


In most cases you do not need to implement your own collections. Instead, consider using ObservableCollection<T> or other existing collections. For more information, see the "Collection Objects Used as Binding Source" in Binding Sources Overview.

<object ItemsSource="bindingDeclaration"/>


A Binding declaration. See Binding Markup Extension for more information.

Identifier field


Metadata properties set to true


.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft