Exemplo n.º 1
0
 public async Task SearchArtists(IEnumerable <Music> source, string keyword, SortBy criterion)
 {
     AllArtists.SetTo(await Task.Run(() => SearchHelper.SearchArtists(source, keyword, criterion)));
     Artists.SetTo(AllArtists.Take(ArtistLimit));
     ArtistsTextBlock.Text           = Settings.settings.ShowCount ? Helper.LocalizeText("ArtistsWithCount", AllArtists.Count) : Helper.LocalizeText("Artists");
     ArtistsViewAllButton.Visibility = AllArtists.Count > ArtistLimit ? Visibility.Visible : Visibility.Collapsed;
     SortArtistsButton.Visibility    = Artists.Count < 2 ? Visibility.Collapsed : Visibility.Visible;
 }
Exemplo n.º 2
0
 private void SortArtistsButton_Click(object sender, RoutedEventArgs e)
 {
     MenuFlyoutHelper.SetSortByMenu(sender, Settings.settings.SearchArtistsCriterion, ArtistsCriteria,
                                    async item =>
     {
         Settings.settings.SearchArtistsCriterion = item;
         LoadingProgress.Visibility = Visibility.Visible;
         AllArtists.SetTo(await Task.Run(() => SearchHelper.SortArtists(AllArtists, CurrentKeyword.Text, item).ToList()));
         Artists.SetTo(AllArtists.Take(Artists.Count));
         LoadingProgress.Visibility = Visibility.Collapsed;
     });
 }