Summary
A notifying list.
- Namespace
- Avalonia
.Collections - Interfaces
-
- IAvaloniaList
<T> - IList
<T> - ICollection
<T> - I
Avalonia Read Only List <T> - IReadOnlyList
<T> - IReadOnlyCollection
<T> - IEnumerable
<T> - I
Notify Collection Changed - I
Notify Property Changed - IList
- ICollection
- IEnumerable
- I
Notify Collection Changed Debug
- IAvaloniaList
- Base Types
-
- object
- Derived Types
graph BT
Type-->Base0["object"]
Type-.->Interface0["IAvaloniaList<T>"]
Type-.->Interface1["IList<T>"]
Type-.->Interface2["ICollection<T>"]
Type-.->Interface3["IAvaloniaReadOnlyList<T>"]
Type-.->Interface4["IReadOnlyList<T>"]
Type-.->Interface5["IReadOnlyCollection<T>"]
Type-.->Interface6["IEnumerable<T>"]
Type-.->Interface7["INotifyCollectionChanged"]
Type-.->Interface8["INotifyPropertyChanged"]
Type-.->Interface9["IList"]
Type-.->Interface10["ICollection"]
Type-.->Interface11["IEnumerable"]
Type-.->Interface12["INotifyCollectionChangedDebug"]
click Interface12 "/api/Avalonia.Diagnostics/INotifyCollectionChangedDebug"
Type["AvaloniaList<T>"]
class Type type-node
Derived0["TextDecorationCollection"]-->Type
click Derived0 "/api/Avalonia.Media/TextDecorationCollection"
Derived1["Transforms"]-->Type
click Derived1 "/api/Avalonia.Media/Transforms"
Derived2["KeyFrames"]-->Type
click Derived2 "/api/Avalonia.Animation/KeyFrames"
Derived3["DataGridSortDescriptionCollection"]-->Type
click Derived3 "/api/Avalonia.Collections/DataGridSortDescriptionCollection"
Derived4["Animator<T>"]-->Type
click Derived4 "/api/Avalonia.Animation.Animators/Animator_1"
Derived5["DefinitionList<T>"]-->Type
click Derived5 "/api/Avalonia.Controls/DefinitionList_1"
Derived6["Classes"]-->Type
click Derived6 "/api/Avalonia.Controls/Classes"
Derived7["Points"]-->Type
click Derived7 "/api/Avalonia/Points"
Derived8["GradientStops"]-->Type
click Derived8 "/api/Avalonia.Media/GradientStops"
Derived9["Transitions"]-->Type
click Derived9 "/api/Avalonia.Animation/Transitions"
Derived10["PathSegments"]-->Type
click Derived10 "/api/Avalonia.Media/PathSegments"
Derived11["DataTemplates"]-->Type
click Derived11 "/api/Avalonia.Controls.Templates/DataTemplates"
Derived12["Controls"]-->Type
click Derived12 "/api/Avalonia.Controls/Controls"
Derived13["PathFigures"]-->Type
click Derived13 "/api/Avalonia.Media/PathFigures"
Syntax
public class AvaloniaList<T> : IAvaloniaList<T>, IList<T>, ICollection<T>,
IAvaloniaReadOnlyList<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>,
INotifyCollectionChanged, INotifyPropertyChanged, IList, ICollection, IEnumerable,
INotifyCollectionChangedDebug
Remarks
AvaloniaList is similar to System.Collections.ObjectModel.ObservableCollection<T>
with a few added features:
-
It can be configured to notify the
event with a action instead of a when the list is cleared by setting to . removed -
A
function can be used to validate each item before insertion. removed
Type Parameters
Name | Description |
---|---|
T | The type of the list items. |
Constructors
Name | Summary |
---|---|
AvaloniaList |
Initializes a new instance of the AvaloniaList<T> class.
|
AvaloniaList |
Initializes a new instance of the AvaloniaList<T> class.
|
AvaloniaList |
Initializes a new instance of the AvaloniaList<T> .
|
AvaloniaList |
Initializes a new instance of the AvaloniaList<T> class.
|
Events
Name | Type | Summary |
---|---|---|
CollectionChanged | Notify |
Raised when a change is made to the collection's items.
|
PropertyChanged | Property |
Raised when a property on the collection changes.
|
Properties
Name | Value | Summary |
---|---|---|
Capacity | int |
Gets or sets the total number of elements the internal data structure can hold without resizing.
|
Count | int |
Gets the number of items in the collection.
|
ResetBehavior | ResetBehavior |
Gets or sets the reset behavior of the list.
|
this[int] | T |
Gets or sets the item at the specified index.
|
Validate | Action |
Gets or sets a validation routine that can be used to validate items before they are
added.
|
Methods
Name | Value | Summary |
---|---|---|
Add |
void |
Adds an item to the collection.
|
AddRange |
void |
Adds multiple items to the collection.
|
Clear |
void |
Removes all items from the collection.
|
Contains |
bool |
Tests if the collection contains the specified item.
|
CopyTo |
void |
Copies the collection's contents to an array.
|
GetEnumerator |
AvaloniaList |
|
GetRange |
IEnumerable |
Gets a range of items from the collection.
|
IndexOf |
int |
Gets the index of the specified item in the collection.
|
Insert |
void |
Inserts an item at the specified index.
|
InsertRange |
void |
Inserts multiple items at the specified index.
|
Move |
void |
Moves an item to a new index.
|
MoveRange |
void |
Moves multiple items to a new index.
|
Remove |
bool |
Removes an item from the collection.
|
RemoveAll |
void |
Removes multiple items from the collection.
|
RemoveAt |
void |
Removes the item at the specified index.
|
RemoveRange |
void |
Removes a range of elements from the collection.
|
Extension Methods
Name | Value | Summary |
---|---|---|
CreateDerivedList |
I |
|
ForEachItem |
IDisposable |
Invokes an action for each item in a collection and subsequently each item added or
removed from the collection.
|
ForEachItem |
IDisposable |
Invokes an action for each item in a collection and subsequently each item added or
removed from the collection.
|
Track |
IDisposable |
Listens for property changed events from all items in a collection.
|