Click or drag to resize

ObservableFilteredCollectionT Class

A simple filtered collection implementation.

This collection contains only the items from the source collection passing the filter.

Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelReadOnlyCollectionT
    TomsToolbox.ObservableCollectionsReadOnlyObservableCollectionAdapterT, ObservableCollectionT
      TomsToolbox.ObservableCollectionsObservableFilteredCollectionT

Namespace:  TomsToolbox.ObservableCollections
Assembly:  TomsToolbox.ObservableCollections (in TomsToolbox.ObservableCollections.dll) Version: 1.0.67.0 (1.0.67.0)
Syntax
public class ObservableFilteredCollection<T> : ReadOnlyObservableCollectionAdapter<T, ObservableCollection<T>>

Type Parameters

T
Type of the items in the collection.

The ObservableFilteredCollectionT type exposes the following members.

Constructors
  NameDescription
Public methodObservableFilteredCollectionT
Initializes a new instance of the ObservableFilteredCollectionT class.
Top
Properties
Methods
Events
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
Remarks
Changes in the source collection will be tracked always, changes in the individual objects that would affect the filter will be tracked when any of the live tracking properties changes.

The order of the elements may be different than the order in the source collection; also changes that affect the items order in the source collection (see Move, Insert(Int32, Object)) will be ignored.

This collection does not hold a reference to the source collection. To keep the source collection alive, the object generating the ObservableFilteredCollectionT must hold a reference to the source collection.

When live tracking is active, Reset of the source collection is not supported.

Contracts
Invariants
_filter != null
_liveTrackingProperties != null
Learn more about contracts
See Also