Method SortDescending
SortDescending()
Sorts the items in descending order based on their comparison logic.
public virtual void SortDescending()
Remarks
This method sorts the collection of items in descending order using a default comparison logic. If the collection is empty, the method performs no operation.
SortDescending<T2>(Comparison<T2>)
Sorts the items in descending order based on the specified comparison logic.
public virtual void SortDescending<T2>(Comparison<T2> comparison) where T2 : TreeViewItem
Parameters
comparisonComparison<T2>A delegate that defines the comparison logic to determine the order of the items. The delegate should return a negative value if the first item is less than the second, zero if they are equal, and a positive value if the first item is greater than the second.
Type Parameters
T2The type of the items to be sorted. Must derive from TreeViewItem.
Remarks
This method performs the sorting operation only if the collection contains items. The sorting is done in descending order by reversing the result of the provided comparison logic.
SortDescending(Comparison<TreeViewItem>)
Sorts the items in descending order based on the specified comparison logic.
public virtual void SortDescending(Comparison<TreeViewItem> comparison)
Parameters
comparisonComparison<TreeViewItem>A delegate that defines the comparison logic to apply to the items. The delegate should return a value less than zero if the first item is less than the second, zero if they are equal, or greater than zero if the first item is greater than the second.
Remarks
This method performs the sorting operation only if the child collection contains items. The sorting is executed in descending order by reversing the result of the provided comparison logic.