Click or drag to resize

ObservableListAdapterT Class

Adapter to return an IList from an IListT.

Most objects that implement IListT also implement IList, however IListT does not derive from IList, so if you get only an interface and don't know the object behind the IListT, its not safe to directly cast to IList. This object provides a wrapper that handles the transition from IListT to IList, preserving observable events. Use e.g. for ListCollectionView to feed it with an IObservableCollectionT.

Inheritance Hierarchy
SystemObject
  TomsToolbox.ObservableCollectionsObservableListAdapterT

Namespace: TomsToolbox.ObservableCollections
Assembly: TomsToolbox.ObservableCollections (in TomsToolbox.ObservableCollections.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class ObservableListAdapter<T> : IList, 
	ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Type Parameters

T
The type of elements in the list.

The ObservableListAdapterT type exposes the following members.

Constructors
 NameDescription
Public methodObservableListAdapterT Initializes a new instance of the ObservableListAdapterT class.
Top
Properties
 NameDescription
Public propertyCount Gets the number of elements contained in the ICollection.
Public propertyIsFixedSize Gets a value indicating whether the IList has a fixed size.
Public propertyIsReadOnly Gets a value indicating whether the IList is read-only.
Public propertyIsSynchronized Gets a value indicating whether access to the ICollection is synchronized (thread safe).
Public propertyItem Gets or sets the element at the specified index.
Public propertySyncRoot Gets an object that can be used to synchronize access to the ICollection.
Top
Methods
 NameDescription
Public methodAdd Adds an item to the IList.
Public methodClear Removes all items from the IList.
Public methodContains Determines whether the IList contains a specific value.
Public methodCopyTo Copies the elements of the ICollection to an Array, starting at a particular Array index.
Public methodGetEnumerator Returns an enumerator that iterates through a collection.
Public methodIndexOf Determines the index of a specific item in the IList.
Public methodInsert Inserts an item to the IList at the specified index.
Public methodRemove Removes the first occurrence of a specific object from the IList.
Public methodRemoveAt Removes the IList item at the specified index.
Top
Events
 NameDescription
Public eventCollectionChanged Occurs when the collection changes.
Public eventPropertyChanged Occurs when a property value changes.
Top
Extension Methods
 NameDescription
Public Extension MethodAddRange Adds the elements of the specified collection to the end of the list.
(Defined by CollectionExtensions)
Public Extension MethodObservableCastTTarget Returns an observable collection of objects of type TTarget that mirrors the source collection.
(Defined by ObservableExtensions)
Public Extension MethodRemoveRange Removes a range of elements from the list.
(Defined by CollectionExtensions)
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
See Also