void LoadPlaylists()
 {
     Options.Add(new ContextMenuCommand(AddToPlaylistCommand, "New Playlist"));
     PlaylistCollection.AddRange(TracksCollection.Elements.SelectMany(t => t.Playlists));
     PlaylistCollection.AddRange(db.playlists.FindAll());
     foreach (var list in PlaylistCollection.DistinctBy(t => t.Name))
     {
         if (list.Songs.Count <= 0)
         {
             AddPlaylist(new Dictionary <Playlist, IEnumerable <Mediafile> >(), list.Name, list.Description);
         }
         else
         {
             var dict = new Dictionary <Playlist, IEnumerable <Mediafile> >();
             dict.Add(list, list.Songs);
             AddPlaylist(dict, list.Name, list.Description);
         }
     }
 }