語言

ICollectionView 介面

定義

可讓集合支援目前的記錄管理、群組和累加式載入 (資料虛擬化) 。

public interface class ICollectionView : IIterable<Platform::Object ^>, IObservableVector<Platform::Object ^>, IVector<Platform::Object ^>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2347286500, 56303, 17631, 129, 38, 163, 26, 137, 18, 29, 220)]
struct ICollectionView : IIterable<IInspectable>, IObservableVector<IInspectable>, IVector<IInspectable>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(2347286500, 56303, 17631, 129, 38, 163, 26, 137, 18, 29, 220)]
public interface ICollectionView : IEnumerable<object>, IList<object>, IObservableVector<object>
Public Interface ICollectionView
Implements IEnumerable(Of Object), IList(Of Object), IObservableVector(Of Object)
屬性
實作
IEnumerable<Object> IIterable<Platform::Object> IIterable<IInspectable> IIterable<T> IEnumerable<T> IList<Object> IVector<Platform::Object> IVector<IInspectable> IVector<T> IList<T> IObservableVector<Object> IObservableVector<Platform::Object> IObservableVector<IInspectable>

Windows 需求

規格需求 Description
裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

ICollectionView 是用來表示集合的介面。 它可用來維護專案選取等屬性的貨幣。

若要在資料來源中實作選取貨幣的自訂行為,您的資料來源應該實作 ICollectionViewFactory ,而不是直接實作 ICollectionView。 您可以將 CollectionViewSource.Source 屬性設定為 ICollectionViewFactory,但如果您將其設定為 ICollectionView,則會擲回例外狀況。

CollectionGroups屬性的類型為IObservableVector < 物件> ,但這些物件應該實作 ICollectionViewGroup。

介面繼承

ICollectionView 繼承 IObservableVector、 IVector 和 IIterable 。 實作 ICollectionView 的類型也會實作 IObservableVector的介面成員,以及適用于 C++ 使用方式的 IVector 和 IIterable 或 Microsoft .NET 用法的 IList和 IEnumerable 。

屬性

名稱 Description
CollectionGroups

傳回與檢視相關聯的任何集合群組。

CurrentItem

取得檢視中的目前項目。

CurrentPosition

取得檢視中 CurrentItem 的序數位置。

HasMoreItems

取得支援累加式載入實作的 sentinel 值。 另請參閱 LoadMoreItemsAsync。

IsCurrentAfterLast

取得值,這個值表示檢視的 CurrentItem 是否超出集合結尾。

IsCurrentBeforeFirst

取得值,這個值表示檢視的 CurrentItem 是否超出集合的開頭。

方法

名稱 Description
LoadMoreItemsAsync(UInt32)

從檢視初始化累加式載入。

MoveCurrentTo(Object)

將指定的專案設定為檢視中的 CurrentItem 。

MoveCurrentToFirst()

將檢視中的第一個專案設定為 CurrentItem。

MoveCurrentToLast()

將檢視中的最後一個專案設定為 CurrentItem。

MoveCurrentToNext()

將檢視中的 CurrentItem 之後的專案設定為 CurrentItem。

MoveCurrentToPosition(Int32)

將位於指定索引的專案設定為檢視中的 CurrentItem 。

MoveCurrentToPrevious()

將檢視中的 CurrentItem 之前的專案設定為 CurrentItem。

事件

名稱 Description
CurrentChanged

實作此介面時,在變更目前專案之後引發此事件。

CurrentChanging

實作此介面時,請在變更目前專案之前引發此事件。 事件處理常式可以取消此事件。

VectorChanged

發生于向量變更時。

(繼承來源 IObservableVector<T>)

適用於

另請參閱