public HomePageViewModel(MainWindow mainForm) { this.mainForm = mainForm; TmpList = AdList; CurrentSelection = Sorts.First(); SortChangedClick(); }
public BrowseAdvertsViewModel(MainWindowViewModel mainForm) { this.mainForm = mainForm; adList = UnitOfWork.Adverts.Get(); TmpList = AdList; CurrentSelection = Sorts.First(); SortChangedClick(); }
public FavoritePageViewModel(MainWindowViewModel mainForm) { this.mainForm = mainForm; User = mainForm.User; adList = UnitOfWork.Adverts.GetFavoriteAdverts(User.User_ID); TmpList = AdList; CurrentSelection = Sorts.First(); SortChangedClick(); }
public IOrderedQueryable <T> ApplySorts(IQueryable <T> queryable) { if (Sorts.Length == 0) { return(DefaultSort.Compile()(queryable)); } var sorted = ApplySort(queryable, Sorts.First()); foreach (var sort in this.Sorts.Skip(1)) { sorted = ApplyNextSort(sorted, sort); } return(sorted); }