protected void ApplySort(ListSortDescriptionCollection sorts) { _SortProperty = null; _SortDescriptions = sorts; var comparer = new PropertyComparer <T>(sorts); ApplySortInternal(comparer); }
protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction) { _SortDirection = direction; _SortProperty = property; var comparer = new PropertyComparer <T>(property, direction); ApplySortInternal(comparer); }
private void ApplySortInternal(PropertyComparer <T> comparer) { if (_OriginalCollection.Count == 0) { _OriginalCollection.AddRange(this); } var listRef = Items as List <T>; if (listRef == null) { return; } listRef.Sort(comparer); _Sorted = true; OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); }