private void DeleteCriteriaButton(object sender, RoutedEventArgs e) { int id = CriteriasListBox.SelectedIndex; if (id != -1) { criterias.RemoveCriteria(id); foreach (var item in Alternatives) { item.RemoveParameter(id); } InitializeListBoxes(); InitializeTreeView(); } }