Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        private void Btn_Aendern_Click(object sender, RoutedEventArgs e)
        {
            if (Dgd_Personen.SelectedItem is Person)
            {
                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);
                }
            }
        }