The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

ComparerChainingExtensions.

ThenByDescending<T, TValue>(IComparer<T>?, Func<T, TValue>, IComparer<TValue>) Method

Summary

Creates a derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted in descending order based on the values returned by the provided selector. The selector values will be compared using the provided comparer or the default comparer for the return type of the selector if no comparer is specified.
Namespace
ReactiveUI
Containing Type
ComparerChainingExtensions

Syntax

public static IComparer<T> ThenByDescending<T, TValue>(this IComparer<T>? parent, Func<T, TValue> selector, IComparer<TValue> comparer)

Type Parameters

Name Description
T The comparison type.
TValue The value type.

Parameters

Name Type Description
parent IComparer<T>? The parent comparer to use first.
selector Func<T, TValue> A function supplying the values for the comparer.
comparer IComparer<TValue> The comparer to use when comparing the values returned by the selector.

Return Value

Type Description
IComparer<T> A comparer.