private void Add_Value_Click(object sender, RoutedEventArgs e) { Button bt = (Button)sender; ParamValueItem valueItem = bt.DataContext as ParamValueItem; RuleItem ruleItem = valueItem.parent; int index = ruleItem.valuesOfParams.IndexOf(valueItem); ruleItem.addValueOfParamByIndex("Пустое значение параметра", index + 1); CollectionViewSource.GetDefaultView(ruleItem.valuesOfParams).Refresh(); }
private void Delete_Value_Click(object sender, RoutedEventArgs e) { Button bt = (Button)sender; ParamValueItem valueItem = bt.DataContext as ParamValueItem; RuleItem ruleItem = valueItem.parent; if (ruleItem.valuesOfParams.Count != 1) { ruleItem.removeValueOfParam(valueItem); CollectionViewSource.GetDefaultView(ruleItem.valuesOfParams).Refresh(); } }