ItemsSourceView 類別

定義

表示指定 ItemsSource 物件與 ItemsRepeater 控件之間所支援互動的標準化檢視。

/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class ItemsSourceView : INotifyCollectionChanged
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
class ItemsSourceView : INotifyCollectionChanged
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public class ItemsSourceView : INotifyCollectionChanged
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public class ItemsSourceView : INotifyCollectionChanged
Public Class ItemsSourceView
Implements INotifyCollectionChanged
繼承
Object IInspectable ItemsSourceView
屬性
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
實作

範例

提示

如需詳細資訊、設計指引和程式碼範例,請參閱 ItemsRepeater

WinUI 3 資源庫應用程式包含大部分 WinUI 3 控制件、特性和功能的互動式範例。 從 Microsoft Store 取得應用程式,或在 GitHub 上取得原始程式碼。

備註

寫入以使用 ItemsRepeater 的元件應該透過 ItemsSourceView 取用 ItemsSource ,因為這可提供 ItemsSource 的標準化檢視。 如此一來,每個元件都不需要知道來源是否為 IEnumerableIVector 或其他專案。

建構函式

ItemsSourceView(Object)

初始化指定數據源 之 ItemsSourceView 類別的新實例。

屬性

Count

取得集合中的項目數目。

HasKeyIndexMapping

取得值,指出專案來源是否可以為每個專案提供唯一索引鍵。

方法

GetAt(Int32)

擷取位於指定索引處的專案。

IndexFromKey(String)

擷取具有指定唯一標識碼的專案索引 (索引鍵) 。

IndexOf(Object)

擷取指定專案的索引。

KeyFromIndex(Int32)

擷取指定索引處專案的唯一標識子 (索引鍵) 。

事件

CollectionChanged

發生於集合已變更以指出變更的原因和變更專案的原因時。

適用於

另請參閱