private void Button_ClickAdd(object sender, RoutedEventArgs e) { Employer emp = new Employer(); WindowEmployer childWin = new WindowEmployer(emp); if (childWin.ShowDialog() == true) { employers.Add(emp); } }
private void Button_ClickEdit(object sender, RoutedEventArgs e) { if (list.SelectedIndex != -1) { Employer emp = list.SelectedItem as Employer; WindowEmployer childWin = new WindowEmployer(emp); if (childWin.ShowDialog() == true) { employers[list.SelectedIndex] = emp; } } }