Exemplo n.º 1
0
        private void setSearchConcert(string name)
        {
            switch (SelectedIndex)
            {
            case 0:
                ConcertsListByDate =
                    new ObservableCollection <ConcertModel>(
                        ConcertsListByDate.Where(poste => poste.Artist == name).ToList());
                break;

            case 1:
                var byKind = ConcertsListFromWeb.OrderBy(concert => concert.Genre).Where(poste => poste.Artist == name).ToList();

                ConcertsListByKind = KingOfConcertGroup <ConcertModel> .CreateGroups(byKind,
                                                                                     System.Threading.Thread.CurrentThread.CurrentUICulture,
                                                                                     (ConcertModel s) => { return(s.Genre); }, true);

                break;

            case 2:
                var byArtist = ConcertsListFromWeb.OrderBy(concert => concert.Artist).Where(poste => poste.Artist == name).ToList();
                ConcertsListByKind = KingOfConcertGroup <ConcertModel> .CreateGroups(byArtist,
                                                                                     System.Threading.Thread.CurrentThread.CurrentUICulture,
                                                                                     (ConcertModel s) => { return(s.Genre); }, true);

                break;
            }
        }
Exemplo n.º 2
0
        private void setPostesListe(bool isNull)
        {
            if (isNull)
            {
                ConcertsListByDate   = new ObservableCollection <ConcertModel>();
                ConcertsListByKind   = new List <KingOfConcertGroup <ConcertModel> >();
                ConcertsListByArtist = new List <KingOfConcertGroup <ConcertModel> >();
            }
            else
            {
                ConcertsListByDate = new ObservableCollection <ConcertModel>(ConcertsListFromWeb.OrderBy(concert => concert.Date).ToList());
                var byKind   = ConcertsListFromWeb.OrderBy(concert => concert.Genre).ToList();
                var byArtist = ConcertsListFromWeb.OrderBy(concert => concert.Artist).ToList();

                ConcertsListByKind = KingOfConcertGroup <ConcertModel> .CreateGroups(byKind,
                                                                                     System.Threading.Thread.CurrentThread.CurrentUICulture,
                                                                                     (ConcertModel s) => { return(s.Genre); }, true);

                ConcertsListByArtist = KingOfConcertGroup <ConcertModel> .CreateGroups(byArtist,
                                                                                       System.Threading.Thread.CurrentThread.CurrentUICulture,
                                                                                       (ConcertModel s) => { return(s.Artist); }, true);
            }
        }