private void BtnNeu_Click(object sender, RoutedEventArgs e) { NeuePerson_Dialog personenDialog = new NeuePerson_Dialog(); personenDialog.DataContext = new Person(); if (personenDialog.ShowDialog() == true) { PersonenListe.Add(personenDialog.DataContext as Person); } }
private void BtnÄndern_Click(object sender, RoutedEventArgs e) { if (dgdPersonen.SelectedValue is Person) { NeuePerson_Dialog personenDialog = new NeuePerson_Dialog(); personenDialog.DataContext = new Person(dgdPersonen.SelectedValue as Person); if (personenDialog.ShowDialog() == true) { PersonenListe[PersonenListe.IndexOf(dgdPersonen.SelectedValue as Person)] = personenDialog.DataContext as Person; } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.wndMain = ((PersonenDB_Bsp.NeuePerson_Dialog)(target)); return; case 2: this.tbxVorname = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.tbxNachname = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.rbtM = ((System.Windows.Controls.RadioButton)(target)); return; case 5: this.rbtW = ((System.Windows.Controls.RadioButton)(target)); return; case 6: this.rbtD = ((System.Windows.Controls.RadioButton)(target)); return; case 7: this.dtpGeburtsdatum = ((System.Windows.Controls.DatePicker)(target)); return; case 8: this.cbbLieblingsfarbe = ((System.Windows.Controls.ComboBox)(target)); return; case 9: this.chbVerheiratet = ((System.Windows.Controls.CheckBox)(target)); return; case 10: this.btnOK = ((System.Windows.Controls.Button)(target)); #line 118 "..\..\NeuePerson_Dialog.xaml" this.btnOK.Click += new System.Windows.RoutedEventHandler(this.BtnOK_Click); #line default #line hidden return; case 11: this.btnCancel = ((System.Windows.Controls.Button)(target)); #line 140 "..\..\NeuePerson_Dialog.xaml" this.btnCancel.Click += new System.Windows.RoutedEventHandler(this.BtnCancel_Click); #line default #line hidden return; } this._contentLoaded = true; }