private void Btn_Neu_Click(object sender, RoutedEventArgs e) { Personendialog dialog = new Personendialog(); if (dialog.ShowDialog() == true) { Personenliste.Add(dialog.DataContext as Person); } }
private void Btn_Aendern_Click(object sender, RoutedEventArgs e) { Personendialog dialog = new Personendialog(); dialog.NeuePerson = new Person(Dgd_Personen.SelectedItem as Person); dialog.DataContext = dialog.NeuePerson; if (dialog.ShowDialog() == true) { Personenliste[Dgd_Personen.SelectedIndex] = dialog.NeuePerson; } }
private void Btn_Aendern_Click(object sender, RoutedEventArgs e) { Personendialog dialog = new Personendialog(); dialog.DataContext = new Person(Dgd_Personen.SelectedItem as Person); dialog.Title = (dialog.DataContext as Person).Vorname + " " + (dialog.DataContext as Person).Nachname; if (dialog.ShowDialog() == true) { Personenliste[Dgd_Personen.SelectedIndex] = (dialog.DataContext as Person); } }