Share via


ItemsSourceView Classe

Définition

Représente une vue standardisée des interactions prises en charge entre un objet ItemsSource donné et un contrôle 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
Héritage
Object IInspectable ItemsSourceView
Attributs
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
Implémente

Exemples

Conseil

Pour plus d’informations, des conseils de conception et des exemples de code, consultez ItemsRepeater.

L’application WinUI 3 Gallery comprend des exemples interactifs de la plupart des contrôles et des fonctionnalités WinUI 3. Procurez-vous l’application sur le Microsoft Store ou le code source sur GitHub.

Remarques

Les composants écrits pour fonctionner avec ItemsRepeater doivent consommer itemsSource via ItemsSourceView, car cela fournit une vue normalisée de l’élément ItemsSource. De cette façon, chaque composant n’a pas besoin de savoir si la source est un IEnumerable, un IVector ou autre chose.

Constructeurs

ItemsSourceView(Object)

Initialise une nouvelle instance de la classe ItemsSourceView pour la source de données spécifiée.

Propriétés

Count

Obtient le nombre d’éléments de la collection.

HasKeyIndexMapping

Obtient une valeur qui indique si la source des éléments peut fournir une clé unique pour chaque élément.

Méthodes

GetAt(Int32)

Récupère l’élément à l’index spécifié.

IndexFromKey(String)

Récupère l’index de l’élément qui a l’identificateur unique (clé) spécifié.

IndexOf(Object)

Récupère l’index de l’élément spécifié.

KeyFromIndex(Int32)

Récupère l’identificateur unique (clé) de l’élément à l’index spécifié.

Événements

CollectionChanged

Se produit lorsque la collection a changé pour indiquer la raison de la modification et les éléments modifiés.

S’applique à

Voir aussi