Exemplo n.º 1
0
 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();
 }
Exemplo n.º 3
0
 public FavoritePageViewModel(MainWindowViewModel mainForm)
 {
     this.mainForm    = mainForm;
     User             = mainForm.User;
     adList           = UnitOfWork.Adverts.GetFavoriteAdverts(User.User_ID);
     TmpList          = AdList;
     CurrentSelection = Sorts.First();
     SortChangedClick();
 }
Exemplo n.º 4
0
        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);
        }