ItemsSourceView Klasse

Definition

Stellt eine standardisierte Ansicht der unterstützten Interaktionen zwischen einem bestimmten ItemsSource-Objekt und einem ItemsRepeater-Steuerelement dar.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

/// [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
Vererbung
Object IInspectable ItemsSourceView
Attribute
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
Implementiert

Beispiele

Tipp

Weitere Informationen, Entwurfsanleitungen und Codebeispiele finden Sie unter Items Repeater.

Die App WinUI 2-Katalog umfasst interaktive Beispiele für die meisten WinUI 2-Steuerelemente, -Features und -Funktionen. Rufen Sie die App aus dem Microsoft Store oder den Quellcode auf GitHub ab.

Hinweise

Komponenten, die für die Arbeit mit ItemsRepeater geschrieben wurden, sollten die ItemsSource über ItemsSourceView nutzen, da dies eine normalisierte Ansicht der ItemsSource bereitstellt. Auf diese Weise muss jede Komponente nicht wissen, ob die Quelle ein IEnumerable, ein IVector oder etwas anderes ist.

Konstruktoren

ItemsSourceView(Object)

Initialisiert eine neue Instanz der ItemsSourceView-Klasse für die angegebene Datenquelle.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

Eigenschaften

Count

Ruft die Anzahl der Elemente in der Auflistung ab.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

HasKeyIndexMapping

Ruft einen Wert ab, der angibt, ob die Elementquelle einen eindeutigen Schlüssel für jedes Element bereitstellen kann.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

Methoden

GetAt(Int32)

Ruft das Element am angegebenen Index ab.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

IndexFromKey(String)

Ruft den Index des Elements ab, das über den angegebenen eindeutigen Bezeichner (Schlüssel) verfügt.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

IndexOf(Object)

Ruft den Index des angegebenen Elements ab.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

KeyFromIndex(Int32)

Ruft den eindeutigen Bezeichner (Schlüssel) für das Element am angegebenen Index ab.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

Ereignisse

CollectionChanged

Tritt auf, wenn die Auflistung geändert wurde, um den Grund für die Änderung anzugeben und welche Elemente geändert wurden.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe Windows App SDK Namespaces).

Gilt für:

Weitere Informationen