Beispiel #1
0
        protected void ApplySort(ListSortDescriptionCollection sorts)
        {
            _SortProperty     = null;
            _SortDescriptions = sorts;
            var comparer = new PropertyComparer <T>(sorts);

            ApplySortInternal(comparer);
        }
Beispiel #2
0
        protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
        {
            _SortDirection = direction;
            _SortProperty  = property;
            var comparer = new PropertyComparer <T>(property, direction);

            ApplySortInternal(comparer);
        }
Beispiel #3
0
        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));
        }