ItemsSourceView Class

Summary

Represents a standardized view of the supported interactions between a given ItemsSource object and an ItemsRepeater control.
Namespace
Avalonia.Controls
Interfaces
  • IDisposable
Base Types
  • INotifyCollectionChanged
Derived Types
graph BT Type-->Base0["INotifyCollectionChanged"] Type-.->Interface0["IDisposable"] Type["ItemsSourceView"] class Type type-node Derived0["ItemsSourceView<T>"]-->Type click Derived0 "/api/Avalonia.Controls/ItemsSourceView_1"

Syntax

public class ItemsSourceView : INotifyCollectionChanged, IDisposable

Remarks

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

Constructors

Name Summary
ItemsSourceView(IEnumerable) Initializes a new instance of the ItemsSourceView class for the specified data source.

Events

Name Type Summary
CollectionChanged NotifyCollectionChangedEventHandler?
Occurs when the collection has changed to indicate the reason for the change and which items changed.

Properties

Name Value Summary
Count int
Gets the number of items in the collection.
Empty ItemsSourceView
Gets an empty ItemsSourceView
static
HasKeyIndexMapping bool
Gets a value that indicates whether the items source can provide a unique key for each item.
this[int] object?
Retrieves the item at the specified index.

Methods

Name Value Summary
Dispose() void
GetAt(int) object?
Retrieves the item at the specified index.
GetOrCreate(IEnumerable?) ItemsSourceView
static
IndexFromKey(string) int
Retrieves the unique identifier (key) for the item at the specified index.
IndexOf(object?) int
KeyFromIndex(int) string
Retrieves the index of the item that has the specified unique identifier (key).
OnItemsSourceChanged(NotifyCollectionChangedEventArgs) void