private void submitBtn_Click(object sender, RoutedEventArgs e) { var newInstitution = new Institution(chiefs.ElementAt(chiefComboBox.SelectedIndex), name.Text); if (!(selected is Institution)) { Org.AddInstitution(newInstitution); } else { ((Institution)selected).Children.Add(newInstitution); } Org.ChiefsList.Remove(chiefs.ElementAt(chiefComboBox.SelectedIndex)); Close(); Main.Activate(); }
public void AddInstitution(Institution institution) { Children.Add(institution); }