private void Persons_MouseDoubleClick(object sender, MouseButtonEventArgs e) { string f = Persons.SelectedItems[0].ToString(); Person p; for (int i = 0; i < count; i++) { if (persons[i].fio.Equals(f)) { p = persons[i]; WindowPerson w = new WindowPerson(p); w.Show(); break; } } }
public void AddPerson() { if (i < count) { WindowPerson window = new WindowPerson(); if (window.ShowDialog() == true) { Person p = new Person(); p.fio = window.getFio(); p.dat = window.getBirth(); p.pol = window.getPol(); p.rost = window.getRost(); p.ves = window.getWeight(); p.ekat = window.getEkat(); persons[i] = p; Persons.Items.Add(p.fio); } i++; } }