protected override void OnReset(IReadOnlyList <TSource> newItems) { _sourceList.Clear(); for (int i = 0; i < newItems.Count; ++i) { _sourceList.Add(i, new ItemSet(_keySelector.Invoke(newItems[i]), newItems[i]) { SourceIndex = i }); } IEnumerable <ItemSet> sortedItems; if (ParameterValue == ListSortDirection.Ascending) { sortedItems = _sourceList.OrderBy(set => set.Key); } else { sortedItems = _sourceList.OrderByDescending(set => set.Key); } sortedItems = sortedItems.Select((set, index) => { set.TargetIndex = index; return(set); }); ResultList.Reset(sortedItems); }