Condividi tramite


ItemsView<TVisual>.ItemsSource Property

Definition

Gets or sets the source of items to template and display.

public System.Collections.IEnumerable ItemsSource { get; set; }
member this.ItemsSource : System.Collections.IEnumerable with get, set

Property Value

System.Collections.IEnumerable

Remarks

While any System.Collections.IEnumerable implementer is accepted, any that do not implement System.Collections.IList or System.Collections.Generic.IReadOnlyList`1 (where T is a class) will be converted to list by iterating.

If your collection implements System.Collections.Specialized.INotifyCollectionChanged, any changes raised from the event on this interface will be reflected in the items view. Note that if the event is raised on another thread the main thread, the results will be unpredictable depending on the platform. To safely modify your collection (and raise the event) from another thread, call EnableCollectionSynchronization(IEnumerable, Object, CollectionSynchronizationCallback) to enable proper synchronization of access to the thread.

Applies to