示例#1
0
        public void New_Click(object sender, RoutedEventArgs e)
        {
            var newplaylist = new AddPlaylistWindow();

            if (newplaylist.ShowDialog() == true)
            {
                Playlist newPlaylist = new Playlist(newplaylist.ListName, new BindingList <Info>(), false, -1);
                _playlistList.Add(newPlaylist);
                PlaylistListView.DataContext = _playlistList;
            }
        }
        private void NewPlaylistMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var newplaylist = new AddPlaylistWindow();

            var menu = sender as MenuItem;
            var info = menu.DataContext as Info;

            if (newplaylist.ShowDialog() == true)
            {
                Playlist newPlaylist = new Playlist(newplaylist.ListName, new BindingList <Info>(), false, -1);
                MainWindow._playlistList.Add(newPlaylist);
                MainWindow._check.ChangePlaylist = true;
                newPlaylist.Song.Add(info);
            }
        }