[]
        
(Showing Draft Content)

C1.LiveLinq.LiveViewExtensions.AsLive

AsLive Method

AsLive<T>(IObservableSource<T>)

Creates a view based on the specified IObservableSource<T> collection.

Declaration
public static View<T> AsLive<T>(this IObservableSource<T> source)
Parameters
Type Name Description
IObservableSource<T> source

The IObservableSource<T> collection to expose as a view.

Returns
Type Description
View<T>

A view that contains the same elements as the IObservableSource<T>

Type Parameters
Name Description
T

The type of the elements in the collection.

Remarks

The resulting view may have its elements ordered differently than they are ordered in the source collection. 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.

AsLive<T>(IObservableSource<T>, ViewOrder)

Creates a view based on the specified IObservableSource<T> collection.

Declaration
public static View<T> AsLive<T>(this IObservableSource<T> source, ViewOrder order)
Parameters
Type Name Description
IObservableSource<T> source

The IObservableSource<T> collection to expose as a view.

ViewOrder order

Specifies whether to preserve source item order.

Returns
Type Description
View<T>

A view that contains the same elements as the IObservableSource<T>

Type Parameters
Name Description
T

The type of the elements in the collection.

Remarks

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.

AsLive<T>(IBindingList)

Creates a view based on the specified IBindingList data source.

Declaration
public static View<T> AsLive<T>(this IBindingList source)
Parameters
Type Name Description
IBindingList source

The IBindingList data source to expose as a view.

Returns
Type Description
View<T>

A view that contains the same elements as the IBindingList.

Type Parameters
Name Description
T

The type of the elements in the view.

Remarks

Use this method to build views from existing data sources. The only requirements for the data source is that it implements the standard data binding interface IBindingList.

The resulting view may have its elements ordered differently than they are ordered in the source collection. 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.

AsLive<T>(IBindingList, ViewOrder)

Creates a view based on the specified IBindingList data source.

Declaration
public static View<T> AsLive<T>(this IBindingList source, ViewOrder order)
Parameters
Type Name Description
IBindingList source

The IBindingList data source to expose as a view.

ViewOrder order

Specifies whether to preserve source item order.

Returns
Type Description
View<T>

A view that contains the same elements as the IBindingList.

Type Parameters
Name Description
T

The type of the elements in the view.

Remarks

Use this method to build views from existing data sources. The only requirements for the data source is that it implements the standard data binding interface IBindingList.

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.

AsLive<T>(BindingList<T>)

A typed specialization of the AsLive<T>(IBindingList) method.

Declaration
public static View<T> AsLive<T>(this BindingList<T> source)
Parameters
Type Name Description
BindingList<T> source

The BindingList<T> data source to expose as a view.

Returns
Type Description
View<T>

A view that contains the same elements as the BindingList<T>.

Type Parameters
Name Description
T

The type of the elements in the view.

AsLive<T>(BindingList<T>, ViewOrder)

A typed specialization of the AsLive<T>(IBindingList, ViewOrder) method.

Declaration
public static View<T> AsLive<T>(this BindingList<T> source, ViewOrder order)
Parameters
Type Name Description
BindingList<T> source

The BindingList<T> data source to expose as a view.

ViewOrder order

Specifies whether to preserve source item order.

Returns
Type Description
View<T>

A view that contains the same elements as the BindingList<T>.

Type Parameters
Name Description
T

The type of the elements in the view.