Observable.GroupBy<TSource, TKey, TElement> Method (IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>)

March 22, 2012

Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.

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

public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(
	this IObservable<TSource> source,
	Func<TSource, TKey> keySelector,
	Func<TSource, TElement> elementSelector,
	IEqualityComparer<TKey> comparer
)

Type Parameters

TSource
TKey
TElement

Parameters

source
Type: System.IObservable<TSource>
keySelector
Type: System.Func<TSource, TKey>
elementSelector
Type: System.Func<TSource, TElement>
comparer
Type: System.Collections.Generic.IEqualityComparer<TKey>

Return Value

Type: System.IObservable<IGroupedObservable<TKey, TElement>>
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

Show: