AvaloniaList<T> Class
A notifying list.
Definition
Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public class AvaloniaList<T> : IAvaloniaList<T>,
IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IAvaloniaReadOnlyList<T>,
IReadOnlyList<T>, IReadOnlyCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged, IList,
ICollection
Public Class AvaloniaList(Of T)
Implements IAvaloniaList(Of T), IList(Of T),
ICollection(Of T), IEnumerable(Of T), IEnumerable, IAvaloniaReadOnlyList(Of T),
IReadOnlyList(Of T), IReadOnlyCollection(Of T), INotifyCollectionChanged, INotifyPropertyChanged,
IList, ICollection
type AvaloniaList<'T> =
class
interface IAvaloniaList<'T>
interface IList<'T>
interface ICollection<'T>
interface IEnumerable<'T>
interface IEnumerable
interface IAvaloniaReadOnlyList<'T>
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface INotifyCollectionChanged
interface INotifyPropertyChanged
interface IList
interface ICollection
end
Type Parameters
- The type of the list items.
Remarks
AvaloniaList is similar to ObservableCollection(T) with a few added features:
- It can be configured to notify the CollectionChanged event with a Remove action instead of a Reset when the list is cleared by setting ResetBehavior to Remove.A Validate function can be used to validate each item before insertion.
Constructors
AvaloniaList(T)() | Initializes a new instance of the AvaloniaList(T) class. |
AvaloniaList(T)(T[]) | Initializes a new instance of the AvaloniaList(T) class. |
AvaloniaList(T)(IEnumerable(T)) | Initializes a new instance of the AvaloniaList(T) class. |
AvaloniaList(T)(Int32) | Initializes a new instance of the AvaloniaList(T). |
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. |
Item(Int32) | 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(IEnumerable(T)) | 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) |
Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetEnumerator() | |
GetHashCode() | Serves as the default hash function. (Inherited from Object) |
GetRange(Int32, Int32) | Gets a range of items from the collection. |
GetType() | Gets 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, IEnumerable(T)) | Inserts multiple items at the specified index. |
MemberwiseClone() | Creates 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(IEnumerable(T)) | 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. |
ToString() | Returns 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
ForEachItem(T)(Action(T), Action(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) |
ForEachItem(T)(Action(Int32, T), Action(Int32, 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) |
TrackItemPropertyChanged(T)(Action(Tuple(Object, PropertyChangedEventArgs))) | Listens for property changed events from all items in a collection. (Defined by AvaloniaListExtensions) |
WeakSubscribe(Action(NotifyCollectionChangedEventArgs)) | 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) |