private void ListPersons_MouseDoubleClick(object sender, MouseButtonEventArgs e) { NewWindow changePerson = new NewWindow(baza); changePerson.PersonForm.DataContext = ListPersons.SelectedItem; changePerson.ShowDialog(); }
private void New_Person_Click(object sender, RoutedEventArgs e) { NewWindow addPerson = new NewWindow(baza); Nobel_Prize_winner person = new Nobel_Prize_winner(); addPerson.PersonForm.DataContext = person; addPerson.ShowDialog(); if ((addPerson.ReturnPerson != null && addPerson.ReturnPerson.FirstName != null && addPerson.ReturnPerson.LastName != null && addPerson.ReturnPerson.Year > 1900)) { NobelList.Add(addPerson.ReturnPerson); } ListPersons.ItemsSource = NobelList; ListPersons.Items.Refresh(); }