ItemsSourceView Class

Definition

Represents a standardized view of the supported interactions between a given ItemsSource object and an ItemsRepeater control.

/// [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
Inheritance
Object IInspectable ItemsSourceView
Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
Implements

Examples

Tip

For more info, design guidance, and code examples, see ItemsRepeater.

The WinUI 3 Gallery app includes interactive examples of most WinUI 3 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.

Remarks

Components written to work with ItemsRepeater should consume the ItemsSource via ItemsSourceView since this provides a normalized view of the ItemsSource. That way, each component does not need to know if the source is an IEnumerable, an IVector, or something else.

Constructors

ItemsSourceView(Object)

Initializes a new instance of the ItemsSourceView class for the specified data source.

Properties

Count

Gets the number of items in the collection.

HasKeyIndexMapping

Gets a value that indicates whether the items source can provide a unique key for each item.

Methods

GetAt(Int32)

Retrieves the item at the specified index.

IndexFromKey(String)

Retrieves the index of the item that has the specified unique identifier (key).

IndexOf(Object)

Retrieves the index of the specified item.

KeyFromIndex(Int32)

Retrieves the unique identifier (key) for the item at the specified index.

Events

CollectionChanged

Occurs when the collection has changed to indicate the reason for the change and which items changed.

Applies to

See also