AvaloniaListT Class

A notifying list.

Definition

Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public class AvaloniaList<T> : IAvaloniaList<T>, 
	IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IAvaloniaReadOnlyList<T>, 
	IReadOnlyList<T>, IReadOnlyCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged, IList, 
	ICollection
Inheritance
Object    AvaloniaListT
Derived
More
Implements
IAvaloniaListT, IAvaloniaReadOnlyListT, ICollectionT, IEnumerableT, IListT, IReadOnlyCollectionT, IReadOnlyListT, ICollection, IEnumerable, IList, INotifyCollectionChanged, INotifyPropertyChanged

Type Parameters

T
The type of the list items.

Remarks

AvaloniaList is similar to ObservableCollectionT with a few added features:

Properties

Capacity Gets or sets the total number of elements the internal data structure can hold without resizing.
Count Gets the number of items in the collection.
ItemInt32 Gets or sets the item at the specified index.
ResetBehavior Gets or sets the reset behavior of the list.
Validate Gets or sets a validation routine that can be used to validate items before they are added.

Methods

Add(T) Adds an item to the collection.
AddRange(IEnumerableT) Adds multiple items to the collection.
Clear Removes all items from the collection.
Contains(T) Tests if the collection contains the specified item.
CopyTo(T, Int32) Copies the collection's contents to an array.
EnsureCapacity(Int32) Ensures that the capacity of the list is at least Capacity.
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetEnumerator 
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetRange(Int32, Int32) Gets a range of items from the collection.
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOf(T) Gets the index of the specified item in the collection.
Insert(Int32, T) Inserts an item at the specified index.
InsertRange(Int32, IEnumerableT) Inserts multiple items at the specified index.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Move(Int32, Int32) Moves an item to a new index.
MoveRange(Int32, Int32, Int32) Moves multiple items to a new index.
Remove(T) Removes an item from the collection.
RemoveAll(IEnumerableT) Removes multiple items from the collection.
RemoveAt(Int32) Removes the item at the specified index.
RemoveRange(Int32, Int32) Removes a range of elements from the collection.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Events

CollectionChanged Raised when a change is made to the collection's items.
PropertyChanged Raised when a property on the collection changes.

Extension Methods

ForEachItemT(ActionT, ActionT, Action, Boolean) Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
(Defined by AvaloniaListExtensions)
ForEachItemT(ActionInt32, T, ActionInt32, T, Action, Boolean) Invokes an action for each item in a collection and subsequently each item added or removed from the collection.
(Defined by AvaloniaListExtensions)
GetWeakCollectionChangedObservable Gets a weak observable for the CollectionChanged event.
(Defined by NotifyCollectionChangedExtensions)
TrackItemPropertyChangedT(ActionTupleObject, PropertyChangedEventArgs) Listens for property changed events from all items in a collection.
(Defined by AvaloniaListExtensions)
WeakSubscribe(ActionNotifyCollectionChangedEventArgs) Subscribes to the CollectionChanged event using a weak subscription.
(Defined by NotifyCollectionChangedExtensions)
WeakSubscribe(NotifyCollectionChangedEventHandler) Subscribes to the CollectionChanged event using a weak subscription.
(Defined by NotifyCollectionChangedExtensions)

See Also