Пример #1
0
        private void Btn_Neu_Click(object sender, RoutedEventArgs e)
        {
            Personendialog dialog = new Personendialog();

            if (dialog.ShowDialog() == true)
            {
                Personenliste.Add(dialog.DataContext as Person);
            }
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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);
            }
        }