//методи, виконувані командами //застосування сортування void ApplyOrderBy() { OrderRecoveryList = TransportList; switch (OrderByFlag) { case eOrderBy.Model: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByModel(TransportList.ToList(), _orderFlag)); break; case eOrderBy.EngineType: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByEngineType(TransportList.ToList(), _orderFlag)); break; case eOrderBy.EnginePower: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByPower(TransportList.ToList(), _orderFlag)); break; case eOrderBy.Axles: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByAxles(TransportList.ToList(), _orderFlag)); break; case eOrderBy.Doors: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByDoors(TransportList.ToList(), _orderFlag)); break; case eOrderBy.PassengerCapacity: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByCapacity(TransportList.ToList(), _orderFlag)); break; case eOrderBy.Seats: TransportList = new ObservableCollection <PublicTransport>(Sorter.BySeats(TransportList.ToList(), _orderFlag)); break; case eOrderBy.LowClearance: TransportList = new ObservableCollection <PublicTransport>(Sorter.ByClearance(TransportList.ToList(), _orderFlag)); break; default: TransportList = OrderRecoveryList; break; } var take = SkipValue; if (SkipValue == 0) { take = TransportList.Count; } TransportList = new ObservableCollection <PublicTransport>(TransportList.Take(take)); }