public MusicPlayer(Playlist playlist)
        {
            LoadPlaylist(playlist);

            if (this.playlist.CurrentSong.Path != "Unknown")
            {
                LoadSong(this.playlist.CurrentSong.Path);
            }

            this.playlist.SongAdded += new SongAddedEventHandler(playlist_SongAdded);
        }
        private void btnAddFolder_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
            if(folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    this.playlist = new Playlist(folderBrowserDialog.SelectedPath);

                    lstSongs.ItemsSource = playlist.Songs;
                    player = new MusicPlayer(playlist);
                    player.SongChanged += new SongChangedEventHandler(player_SongChanged);
                    lstSongs.Items.Refresh();
                    SetBindings();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
 public void LoadPlaylist(Playlist playlist)
 {
     this.playlist = playlist;
 }