public void ApplySort(ListSortDescriptionCollection sortCollection) { bool oldRaise = RaiseListChangedEvents; RaiseListChangedEvents = false; try { PropertyComparerCollection <T> tmp = new PropertyComparerCollection <T>(sortCollection); List <T> items = new List <T>(this); items.Sort(tmp); int index = 0; foreach (T item in items) { SetItem(index++, item); } this.sorts = tmp; } finally { RaiseListChangedEvents = oldRaise; ResetBindings(); } }
protected override void RemoveSortCore() { this.sorts = null; }