Ejemplo n.º 1
0
 private void SortAlbumsButton_Click(object sender, RoutedEventArgs e)
 {
     MenuFlyoutHelper.SetSortByMenu(sender, Settings.settings.SearchAlbumsCriterion, AlbumsCriteria,
                                    async item =>
     {
         Settings.settings.SearchAlbumsCriterion = item;
         LoadingProgress.Visibility = Visibility.Visible;
         AllAlbums.SetTo(await Task.Run(() => SearchHelper.SortAlbums(AllAlbums, CurrentKeyword.Text, item).ToList()));
         Albums.SetTo(AllAlbums.Take(Albums.Count));
         LoadingProgress.Visibility = Visibility.Collapsed;
     });
 }
Ejemplo n.º 2
0
 private void SortButton_Click(object sender, RoutedEventArgs e)
 {
     MenuFlyoutHelper.SetSortByMenu(sender, Settings.settings.AlbumsCriterion, SortByCriteria,
                                    async criterion =>
     {
         AlbumPageProgressRing.Visibility = Visibility.Visible;
         Albums.SetTo(await Task.Run(() => Sort(criterion, Albums)));
         AlbumPageProgressRing.Visibility = Visibility.Collapsed;
     },
                                    async() =>
     {
         AlbumPageProgressRing.Visibility = Visibility.Visible;
         Albums.CopyAndSetTo(await Task.Run(() =>
         {
             var albums = Albums.Reverse();
             BuildAlbumInfoList(albums);
             return(albums);
         }));
         AlbumPageProgressRing.Visibility = Visibility.Collapsed;
     });
 }
Ejemplo n.º 3
0
 private void SortPlaylistsButton_Click(object sender, RoutedEventArgs e)
 {
     MenuFlyoutHelper.SetSortByMenu(sender, Settings.settings.SearchPlaylistsCriterion, PlaylistsCriteria,
                                    async item =>
     {
         Settings.settings.SearchPlaylistsCriterion = item;
         LoadingProgress.Visibility = Visibility.Visible;
         int nowPlayingIndex        = AllPlaylists.FindIndex(i => i.Name == MenuFlyoutHelper.NowPlaying);
         if (nowPlayingIndex >= 0)
         {
             AllPlaylists.RemoveAt(nowPlayingIndex);
         }
         int myFavoritesIndex = AllPlaylists.FindIndex(i => i.Name == MenuFlyoutHelper.MyFavorites);
         if (myFavoritesIndex >= 0)
         {
             AllPlaylists.RemoveAt(myFavoritesIndex);
         }
         AllPlaylists.SetTo(await Task.Run(() => SearchHelper.SortPlaylists(AllPlaylists, CurrentKeyword.Text, item).ToList()));
         Playlists.SetTo(AllPlaylists.Take(Playlists.Count));
         LoadingProgress.Visibility = Visibility.Collapsed;
     });
 }
Ejemplo n.º 4
0
 private void SortButton_Click(object sender, RoutedEventArgs e)
 {
     MenuFlyoutHelper.SetSortByMenu(sender, SettingsCriterion, Criteria, item => SettingsCriterion = item);
 }