예제 #1
0
        private void PlaySongBtn(object sender, RoutedEventArgs e)
        {
            string baseUrl = "https://www.youtube.com/watch?v=";

            try
            {
                DataRowView row           = (DataRowView)DetailedNummerGrid.SelectedItems[0];
                string      nummerNaam    = row["titel"].ToString();
                string      nummerArtiest = row["artiest"].ToString();
                Youtube.GetYoutubeId(nummerArtiest, nummerNaam);
                if (Youtube.YoutubeId != String.Empty)
                {
                    YoutubePlayer.Navigate(baseUrl + Youtube.YoutubeId);
                    YoutubePlayer.Visibility = Visibility.Visible;
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: " + ex.Message);
            }
        }