コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: pietvanvliet/mpdcwp
 // Divide tracks into albums and artists
 // TODO muuta parsintakohtaan
 private void DivideTracks()
 {
     Artists.Clear();
     Artist lastArtist = null; // Nopeuttamaan hakua
     foreach (Track track in AllTracks)
     {
         if (lastArtist != null && lastArtist.Name.Equals(track.Artist))
         {
             lastArtist.AddSong(track);
         }
         else
         {
             if (Artists.TryGetValue(track.Artist, out lastArtist))
             {
                 lastArtist.AddSong(track);
             }
             else
             {
                 lastArtist = new Artist() { Name = track.Artist };
                 lastArtist.AddSong(track);
                 Artists.Add(track.Artist, lastArtist);
             }
         }
     }
 }
コード例 #2
0
 // Go back, if possible
 private void GoBack()
 {
     SelectedArtist = null;
     if (NavigationService.CanGoBack)
         NavigationService.GoBack();
 }