ItemsView<TVisual>.ItemsSource 屬性

定義

取得或設定要樣板化和顯示的項目來源。

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

屬性值

備註

接受任何 IEnumerable 實作者時,不會實 IList 作或 IReadOnlyList<T> (其中 T 是類別) 會逐一查看來轉換成清單。

如果您的集合實作 INotifyCollectionChanged ,則此介面上事件引發的任何變更都會反映在專案檢視中。 請注意,如果在另一個執行緒上引發事件,主執行緒就會無法預期結果,視平臺而定。 若要安全地修改集合 (並從另一個執行緒引發事件) ,請呼叫 EnableCollectionSynchronization(IEnumerable, Object, CollectionSynchronizationCallback) 以啟用執行緒的適當存取同步處理。

適用於