/// <summary> /// Sorts the list using the given comparer./> /// </summary> public void Sort(IComparer <T> comparer) { using (DeferredUpdate()) using (Lock.WriteUsing()) { Backing.Sort(comparer); } OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move)); }
/// <summary> /// Sorts the list using the given selector and comparer./> /// </summary> public void Sort <TKey>(Func <T, TKey> selector, IComparer <TKey> comparer = null) { using (DeferredUpdate()) using (Lock.WriteUsing()) { comparer = comparer ?? Comparer <TKey> .Default; Backing.Sort(new TransformComparer <T, TKey>(selector, comparer)); } OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move)); }