예제 #1
0
        protected void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
        {
            SortDirectionCore = direction;
            SortPropertyCore  = property;
            var pc = new PropertyComparer <T>(property, direction);

            Sort(pc);
            IsSortedCore = true;
        }
예제 #2
0
        protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
        {
            // Get list to sort
            var items = Items as List <T>;

            _sortDirection = direction;
            _sortProperty  = property;

            // Apply and set the sort, if items to sort
            if (items != null)
            {
                var pc = new PropertyComparer <T>(property, direction);
                items.Sort(pc);
                _isSorted = true;
            }
            else
            {
                _isSorted = false;
            }

            // Let bound controls know they should refresh their views
            OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
        }