Beispiel #1
0
        private void Add_Main(bool adding)
        {
            if (adding)
            {
                likedSongs.MouseLeave += ((s, e) => likedImage.Opacity = 0.25);
                likedSongs.MouseEnter += ((s, e) => likedImage.Opacity = 0.5);
                likedSongs.MouseDown  += ((s, e) => {
                    Spotify.LoveSong(_spotify.GetPlayingTrack().Item.Id);
                    foreach (Window window in Application.Current.Windows)
                    {
                        if (window.GetType() == typeof(MainWindow))
                        {
                            (window as MainWindow).loveClick.Content = "♥";
                        }
                    }
                });
            }
            else
            {
                List <string> songs = new List <string>();
                _spotify.GetSavedTracks().Items.ForEach((song) => songs.Add(song.Track.Uri));

                likedSongs.MouseLeave += ((s, e) => likedImage.Opacity = 0.25);
                likedSongs.MouseEnter += ((s, e) => likedImage.Opacity = 0.5);
                likedSongs.MouseDown  += (s, e) => _spotify.ResumePlayback(uris: songs, offset: "");
            }
        }
Beispiel #2
0
        private void Love_Click(object sender, RoutedEventArgs e)
        {
            ListResponse <bool> tracksSaved = _spotify.CheckSavedTracks(new System.Collections.Generic.List <String> {
                _songID
            });

            if (tracksSaved.List[0])
            {
                Spotify.UnLoveSong(_songID);
                loveClick.Content = "♡";
            }
            else
            {
                Spotify.LoveSong(_songID);
                loveClick.Content = "♥";
            }
        }