private void addPersonButton_Click(object sender, RoutedEventArgs e) { EditPersonWindow editPersonWindow1 = new EditPersonWindow(); Person p = new Person(); //editPersonWindow1. model1.Persons.AddObject(p); //model1.Projects.First().Persons.Add(p); }
private void personsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (personsDataGrid.SelectedIndex != -1) { EditPersonWindow editPersonWindow1 = new EditPersonWindow(); var t = personsDataGrid.SelectedItem; int id = (int)t.GetType().GetProperty("Id").GetValue(t, null); editPersonWindow1.Person_Id = id; editPersonWindow1.ShowDialog(); } }