Class ObservableListWrap
Wraps a list to provide notifications when the collection's content changes.
Inheritance
Implements
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.Mvvm.dll
Syntax
public class ObservableListWrap : ObservableWrapBase, INotifyPropertyChangeBase, IRefreshable, INotifyPropertyChanged, IList, ICollection, IEnumerable, INotifyCollectionChanged
Constructors
| Edit this page View SourceObservableListWrap()
Initializes a new instance of the ObservableListWrap class.
Declaration
public ObservableListWrap()
ObservableListWrap(IList)
Initializes a new instance of the ObservableListWrap class.
Declaration
public ObservableListWrap(IList list)
Parameters
| Type | Name | Description |
|---|---|---|
| IList | list | List to use as the underlying list. |
Properties
| Edit this page View SourceCount
Gets the number of elements contained in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsFixedSize
Gets a value indicating whether this list has a fixed size.
Declaration
public bool IsFixedSize { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsReadOnly
Gets a value indicating whether this list is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsSynchronized
Gets a value indicating whether access to this ICollection is synchronized (thread safe).
Declaration
public bool IsSynchronized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[int]
Provides indexed access to the contents of this ObservableListWrap.
Declaration
public object? this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the element to get or set. |
Property Value
| Type | Description |
|---|---|
| object | The element at the specified index in the collection. |
SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
Declaration
public object SyncRoot { get; }
Property Value
| Type | Description |
|---|---|
| object |
UnderlyingList
Gets direct access to the underlying list managed by this ObservableListWrap.
Declaration
public IList? UnderlyingList { get; }
Property Value
| Type | Description |
|---|---|
| IList |
Methods
| Edit this page View SourceAdd(object?)
Adds an item to this ObservableListWrap.
Declaration
public int Add(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | Value to add to this ObservableListWrap. |
Returns
| Type | Description |
|---|---|
| int | The index at which the item was added. |
Clear()
Removes all items from this ObservableListWrap.
Declaration
public void Clear()
Contains(object?)
Determines whether this ObservableListWrap contains a specified value.
Declaration
public override bool Contains(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | Value to check for. |
Returns
| Type | Description |
|---|---|
| bool | true if this ObservableListWrap contains the specified value; otherwise false. |
Overrides
| Edit this page View SourceCopyTo(Array, int)
Copies the elements of this ObservableListWrap to an array, starting at a particular array index.
Declaration
public void CopyTo(Array array, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | array | Destination array for the copy. |
| int | index | Index in the destination array at which to start copying. |
IndexOf(object?)
Returns the index of a specific item in this ObservableListWrap.
Declaration
public override int IndexOf(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | Value whose index to get in this ObservableListWrap. |
Returns
| Type | Description |
|---|---|
| int | The index of the item in this ObservableListWrap. |
Overrides
| Edit this page View SourceInsert(int, object?)
Inserts an item into this ObservableListWrap at the specified index.
Declaration
public void Insert(int index, object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index at which to insert the item. |
| object | value | Value to insert into this ObservableListWrap. |
OnGetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
protected override IEnumerator OnGetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator | An enumerator that can be used to iterate through the collection. |
Overrides
| Edit this page View SourceRefresh()
Forces notification that the list has changed.
Declaration
public override void Refresh()
Overrides
| Edit this page View SourceRefreshAt(int)
Forces a refresh of the item at the specified index.
Declaration
public void RefreshAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the item to refresh. |
Remove(object?)
Removes an item from this ObservableListWrap.
Declaration
public void Remove(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | Value to remove from this ObservableListWrap. |
RemoveAt(int)
Removes the item at the specified index from this ObservableListWrap.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the item to remove. |
Substitute(IList)
Replaces the underlying list with a new one.
Declaration
public void Substitute(IList newList)
Parameters
| Type | Name | Description |
|---|---|---|
| IList | newList | List to set as the underlying list. |