Observable.TakeWhile<TSource> Method

March 22, 2012

Returns values from an observable sequence as long as a specified condition is true, and then skips the remaining values.

Namespace:  Microsoft.Phone.Reactive
Assembly:  Microsoft.Phone.Reactive (in Microsoft.Phone.Reactive.dll)

public static IObservable<TSource> TakeWhile<TSource>(
	this IObservable<TSource> source,
	Func<TSource, bool> predicate

Type Parameters



Type: System.IObservable<TSource>
Type: System.Func<TSource, Boolean>

Return Value

Type: System.IObservable<TSource>
Returns IObservable<T>.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservable<TSource>. When you use instance method syntax to call this method, omit the first parameter.

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone