private void BtnNew_Click(object sender, RoutedEventArgs e) { AddCdWindow addCdWindow = new AddCdWindow(); addCdWindow.ShowDialog(); _cds = Repository.GetInstance().GetAllCds(); lbxCds.ItemsSource = _cds; }
private void BtnNew_Click(object sender, RoutedEventArgs e) { AddCdWindow addCdWindow = new AddCdWindow(); addCdWindow.ShowDialog(); //Nachdem der "Neuanlegen Dialog" geschlossen wurde //Liste der CDs aktualisieren: _cds = Repository.GetInstance().GetAllCds(); //Bei normaler Collection muss zusätzlich ItemSource neu gesetzt werden um Aktualisierung auszulösen lbxCds.ItemsSource = _cds; }
private void BtnEdit_Click(object sender, RoutedEventArgs e) { Cd selectedItem = listBoxCds.SelectedItem as Cd; AddCdWindow addCdWindow = new AddCdWindow(selectedItem); addCdWindow.ShowDialog(); Repository repository = Repository.GetInstance(); _cds = repository.GetAllCds(); listBoxCds.ItemsSource = _cds; }
private void BtnEdit_Click(object sender, RoutedEventArgs e) { Cd selectedCd = lbxCds.SelectedItem as Cd; if (selectedCd == null) { MessageBox.Show("Sie müssen eine Cd auswählen!"); } else { AddCdWindow addCdWindow = new AddCdWindow(selectedCd); addCdWindow.ShowDialog(); } _cds = Repository.GetInstance().GetAllCds(); lbxCds.ItemsSource = _cds; }
void btnNew_Click(object sender, RoutedEventArgs e) { AddCdWindow addCdWindow = new AddCdWindow(); addCdWindow.ShowDialog(); }