public PlaylistHeaderViewModel(Playlist playlist)
 {
     Playlist = playlist;
     Play = new UiCommand(o => DispatcherLibrary.Dispatcher.Dispatch("Playlist Plugin: Set Playlist", playlist));
     Playlist.PlaylistStateChanged += (sender, state) =>
     {
         if (sender == Playlist)
         {
             PlaylistState = state;
         }
     };
 }
 public void CreatePlaylist(string name, IEnumerable<TrackDefinition> tracks)
 {
     var playlist = SavedPlaylists.FirstOrDefault(p => p.Name == name);
     if (playlist != null)
     {
         AddToPlaylist(name, tracks);
         return;
     }
     var newPlaylist = new Playlist {Name = name};
     foreach (var track in tracks)
         newPlaylist.AddTrack(track);
     SavedPlaylists.Add(newPlaylist);
     Save();
 }
 public void OnPlaylistDelete(Playlist p)
 {
     SavedPlaylists.Remove(p);
     Save();
 }
 public void OnPlaylistView(Playlist p)
 {
     CurrentPlaylist = p;
     PlayQueue = false;
 }
Exemplo n.º 5
0
 private static void StateChanged(Playlist sender, PlaylistState state)
 {
     PlaylistStateChanged?.Invoke(sender, state);
 }
Exemplo n.º 6
0
 private static void StateChanged(Playlist sender, PlaylistState state)
 {
     PlaylistStateChanged?.Invoke(sender, state);
 }