[]
Creates a view based on the specified INotifyCollectionChanged data source.
public static View<T> AsLive<T>(this INotifyCollectionChanged source)
Type | Name | Description |
---|---|---|
INotifyCollectionChanged | source | The INotifyCollectionChanged data source to expose as a view. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the INotifyCollectionChanged data source. |
Name | Description |
---|---|
T | The type of the elements in the view. |
Use this method to build views from existing data sources implementing INotifyCollectionChanged. The element type of this data source must implement INotifyPropertyChanged, see Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects.
The resulting view may have its elements ordered differently than they are ordered in the source. Correspondingly, views built on this resulting view (for example, if you filter it with Where) will not preserve the source order either. If you need to preserve the source order, consider using the other AsLive overload where you can specify to what extent you need the order to be preserved.
Creates a view based on the specified INotifyCollectionChanged data source.
public static View<T> AsLive<T>(this INotifyCollectionChanged source, ViewOrder order)
Type | Name | Description |
---|---|---|
INotifyCollectionChanged | source | The INotifyCollectionChanged data source to expose as a view. |
ViewOrder | order | Specifies whether to preserve source item order. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the INotifyCollectionChanged data source. |
Name | Description |
---|---|
T | The type of the elements in the view. |
Use this method to build views from existing data sources implementing INotifyCollectionChanged. The element type of this data source must implement INotifyPropertyChanged, see Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects.
If the order parameter specifies preserving item order, the order of items in the source is preserved, at a certain performance cost, in the resulting view and in views based on it (for example, if you filter it with Where).
Note that Join does not preserve source order. If you need to order a join result, use OrderBy after Join.
A typed specialization of the AsLive<T>(INotifyCollectionChanged) method.
public static View<T> AsLive<T>(this ObservableCollection<T> source)
Type | Name | Description |
---|---|---|
ObservableCollection<T> | source | The ObservableCollection<T> to expose as a view. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the ObservableCollection<T>. |
Name | Description |
---|---|
T | The type of the elements in the view. |
A typed specialization of the AsLive<T>(INotifyCollectionChanged, ViewOrder) method.
public static View<T> AsLive<T>(this ObservableCollection<T> source, ViewOrder order)
Type | Name | Description |
---|---|---|
ObservableCollection<T> | source | The ObservableCollection<T> to expose as a view. |
ViewOrder | order | Specifies whether to preserve source item order. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the ObservableCollection<T>. |
Name | Description |
---|---|
T | The type of the elements in the view. |
A typed specialization of the AsLive<T>(INotifyCollectionChanged) method.
public static View<T> AsLive<T>(this ReadOnlyObservableCollection<T> source)
Type | Name | Description |
---|---|---|
ReadOnlyObservableCollection<T> | source | The ReadOnlyObservableCollection<T> to expose as a view. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the ReadOnlyObservableCollection<T>. |
Name | Description |
---|---|
T | The type of the elements in the view. |
A typed specialization of the AsLive<T>(INotifyCollectionChanged, ViewOrder) method.
public static View<T> AsLive<T>(this ReadOnlyObservableCollection<T> source, ViewOrder order)
Type | Name | Description |
---|---|---|
ReadOnlyObservableCollection<T> | source | The ReadOnlyObservableCollection<T> to expose as a view. |
ViewOrder | order | Specifies whether to preserve source item order. |
Type | Description |
---|---|
View<T> | A view that contains the same elements as the ReadOnlyObservableCollection<T>. |
Name | Description |
---|---|
T | The type of the elements in the view. |