Class ObservableList<T>
Extends List{T} with events.
Inheritance
System.Object
ObservableList<T>
Implements
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
Assembly: Syncfusion.Shared.Base.dll
public class ObservableList<T> : Object, IList, ICollection, IEnumerable
Type Parameters
| Name |
Description |
| T |
Type of collection elements.
|
Constructors
Declaration
Declaration
public ObservableList(int capacity)
Parameters
| Type |
Name |
Description |
| System.Int32 |
capacity |
|
Properties
Declaration
public int Capacity { get; set; }
Property Value
Declaration
public int Count { get; }
Property Value
Gets or sets the element at the specified index.
Declaration
public T this[int index] { get; set; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Property Value
Declaration
protected IList List { get; }
Property Value
| Type |
| System.Collections.IList |
Methods
Declaration
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Removes all items from the list.
Declaration
Determines whether the list contains a specific value.
Declaration
public bool Contains(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Declaration
public IEnumerator GetEnumerator()
Returns
| Type |
| System.Collections.IEnumerator |
Determines the index of a specific item in the list.
Declaration
public int IndexOf(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Inserts an item to the list at the specified index.
Declaration
public void Insert(int index, T value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| T |
value |
|
Declaration
protected virtual void OnClear()
Declaration
protected virtual void OnClearCompleted()
Performs additional custom processes before inserting a new element into the collection.
Declaration
protected virtual bool OnInsert(int index, object value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Boolean |
TRUE to insert object
|
Declaration
protected virtual void OnInsertComplete(int index, object value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| System.Object |
value |
|
Performs additional custom processes when removing an element from the collection.
Declaration
protected virtual bool OnRemove(int index, object value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Boolean |
TRUE to remove object
|
Declaration
protected virtual void OnRemoveComplete(int index, object value)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| System.Object |
value |
|
Removes the first occurrence of a specific object from the collection.
Declaration
public void Remove(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Removes item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Declaration
public void Sort(IComparer comparer)
Parameters
| Type |
Name |
Description |
| System.Collections.IComparer |
comparer |
|
Events
Fired when new item is added to the collection.
Declaration
public event EventHandler<ListItemEventArgs<T>> ItemAdded
Event Type
Fired when item is removed from collection.
Declaration
public event EventHandler<ListItemEventArgs<T>> ItemRemoved
Event Type
Implements
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable