Пример #1
0
        private void MimRemovePlaylist_Click(object sender, RoutedEventArgs e)
        {
            IPlaylist     playlist = FrameworkUtils.GetDataContext <IPlaylist>(sender);
            IAudioService service  = viewModel.Service.AudioService;

            if (service.CurrentPlaylist == playlist)
            {
                service.CurrentPlaylist = service.GetAllPlaylists().Where(p => p != playlist).Any() ?
                                          service.GetAllPlaylists().Next(playlist).next : null;
            }

            if (playlist is ISourcePlaylist)
            {
                service.SourcePlaylists.Remove((ISourcePlaylist)playlist);
            }
            else
            {
                service.Playlists.Remove(playlist);
            }
        }
Пример #2
0
        private void MimRemixSongs_Click(object sender, RoutedEventArgs e)
        {
            IPlaylist playlist = FrameworkUtils.GetDataContext <IPlaylist>(sender);

            playlist.Songs = playlist.Songs.Shuffle().ToArray();
        }
Пример #3
0
 private async void MimReloadSongs_Click(object sender, RoutedEventArgs e)
 {
     await FrameworkUtils.GetDataContext <ISourcePlaylist>(sender).Reload();
 }