private async void ListViewPlaylists_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var playlist = (Playlist)ListViewPlaylists.SelectedValue; if (playlist != null) { try { if (await PlaylistRepository.AddTrack(this.track.idTrack, playlist.idPlaylist)) { MessageBox.Show("Added to playlist"); Window.GetWindow(this).Close(); } }catch (Exception ex) { MessageBox.Show(ex.Message); } } }