CompositeCollection 類別

定義

允許以單一清單顯示多個集合和項目。

public ref class CompositeCollection : System::Collections::IList, System::Collections::Specialized::INotifyCollectionChanged, System::ComponentModel::ICollectionViewFactory, System::Windows::IWeakEventListener
[System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)]
public class CompositeCollection : System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.ICollectionViewFactory, System.Windows.IWeakEventListener
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)>]
type CompositeCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
    interface INotifyCollectionChanged
    interface ICollectionViewFactory
    interface IWeakEventListener
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)>]
type CompositeCollection = class
    interface ICollection
    interface IEnumerable
    interface IList
    interface INotifyCollectionChanged
    interface ICollectionViewFactory
    interface IWeakEventListener
Public Class CompositeCollection
Implements ICollectionViewFactory, IList, INotifyCollectionChanged, IWeakEventListener
繼承
CompositeCollection
屬性
實作

備註

CompositeCollection 可以包含字串、物件、XML 節點、專案和其他集合等專案。 ItemsControl會使用 中的資料 CompositeCollection ,根據 ItemTemplate 中的資料來產生其內容。 如需使用 ItemsControl 物件系結至集合的詳細資訊,請參閱 資料系結概觀的一節。

建構函式

CompositeCollection()

建立 CompositeCollection 類別的新執行個體,其為空白且具有預設的初始容量。

CompositeCollection(Int32)

建立 CompositeCollection 類別的新執行個體,這個執行個體是空白且可具有指定的初始容量。

屬性

Count

取得儲存在此集合中的項目數。

Item[Int32]

索引子屬性,擷取或取代集合中指定以零為起始之位移 (Offset) 位置的項目。

方法

Add(Object)

將指定的項目加入至集合。

Clear()

清除集合。

Contains(Object)

檢查指定項目是否位於這個集合中。

CopyTo(Array, Int32)

從這個集合建立物件參考的淺層複本 (Shallow Copy) 至指定的陣列。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(Object)

傳回此集合中的索引,表示找到指定項目的位置。

Insert(Int32, Object)

將項目插入至位於指定索引的集合。 指定位置之後的所有項目都會下移一個位置。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ReceiveWeakEvent(Type, Object, EventArgs)

從集中式事件資料表處理事件。

Remove(Object)

從集合中移除指定的項目參考。 所有剩下的項目都會上移一個位置。

RemoveAt(Int32)

從集合中的指定索引處移除項目。 所有剩下的項目都會上移一個位置。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

事件

CollectionChanged

集合變更 (新增或移除項目) 時發生。

明確介面實作

ICollection.IsSynchronized

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

ICollection.SyncRoot

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

ICollectionViewFactory.CreateView()

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

IEnumerable.GetEnumerator()

傳回列舉值。

IList.IsFixedSize

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

IList.IsReadOnly

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

INotifyCollectionChanged.CollectionChanged

發生於集合變更時。

IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

此成員支援Windows Presentation Foundation (WPF) 基礎結構,而且不適合直接從程式碼使用。

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱