Table of Contents

Class ItemsSourceView

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Represents a standardized view of the supported interactions between an items collection and an items control.

public class ItemsSourceView : IReadOnlyList<object?>, IReadOnlyCollection<object?>, IEnumerable<object?>, IList, ICollection, IEnumerable, INotifyCollectionChanged
Inheritance
ItemsSourceView
Implements
Derived
Inherited Members

Properties

Count

Gets the number of items in the collection.

public int Count { get; }

Property Value

int

Empty

Gets an empty ItemsSourceView

public static ItemsSourceView Empty { get; }

Property Value

ItemsSourceView

this[int]

Retrieves the item at the specified index.

public object? this[int index] { get; }

Parameters

index int

The index.

Property Value

object

The item.

Source

Gets the source collection.

public IList Source { get; }

Property Value

IList

Methods

Contains(object?)

public bool Contains(object? item)

Parameters

item object

Returns

bool

GetAt(int)

Retrieves the item at the specified index.

public object? GetAt(int index)

Parameters

index int

The index.

Returns

object

The item.

GetEnumerator()

public IEnumerator<object?> GetEnumerator()

Returns

IEnumerator<object>

GetOrCreate(IEnumerable?)

Gets or creates an ItemsSourceView for the specified enumerable.

public static ItemsSourceView GetOrCreate(IEnumerable? items)

Parameters

items IEnumerable

The enumerable.

Returns

ItemsSourceView

Remarks

This method handles the following three cases:

GetOrCreate<T>(IEnumerable<T>?)

Gets or creates an ItemsSourceView<T> for the specified enumerable.

public static ItemsSourceView<T> GetOrCreate<T>(IEnumerable<T>? items)

Parameters

items IEnumerable<T>

The enumerable.

Returns

ItemsSourceView<T>

Type Parameters

T

Remarks

This method handles the following three cases:

GetOrCreate<T>(IEnumerable?)

Gets or creates an ItemsSourceView<T> for the specified enumerable.

public static ItemsSourceView<T> GetOrCreate<T>(IEnumerable? items)

Parameters

items IEnumerable

The enumerable.

Returns

ItemsSourceView<T>

Type Parameters

T

Remarks

This method handles the following three cases:

IndexOf(object?)

public int IndexOf(object? item)

Parameters

item object

Returns

int

Events

CollectionChanged

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

public event NotifyCollectionChangedEventHandler? CollectionChanged

Event Type

NotifyCollectionChangedEventHandler