private void lstAlbums_SelectionChanged(object sender, SelectionChangedEventArgs e) { MusicEntity music = (MusicEntity)lstAlbums.SelectedItems[0]; txt_AlbumName.Text = music.AlbumName; txt_NoOfTracks.Text = music.NoOfTracks.ToString(); txt_Price.Text = music.Price.ToString(); }
private void btnAddAlbum_Click(object sender, RoutedEventArgs e) { MusicEntity m = new MusicEntity(); m.AlbumName = txtAlbumName.Text; m.NoOfTracks = int.Parse(txtNoOfTracks.Text); m.Price = int.Parse(txtPrice.Text); lstAlbums.Items.Add(m); }