private void Button_Click_Remove_Grad(object sender, RoutedEventArgs e) { CriterionForm parent = (sender as ButtonWithParent).criterionParent; GradationWithButton gradParent = (sender as ButtonWithParent).gradationParent; parent.betweenSP.Children.Remove(parent.gradationsList[parent.gradationsList.IndexOf(gradParent)].line); parent.gradationsList.Remove(gradParent); }
private void Button_Click_Add_Grad(object sender, RoutedEventArgs e) { CriterionForm parent = (sender as ButtonWithParent).criterionParent; parent.gradationsList.Add(new GradationWithButton(parent)); parent.gradationsList[parent.gradationsList.Count - 1].removeGrad.Click += Button_Click_Remove_Grad; parent.betweenSP.Children.Add(parent.gradationsList[parent.gradationsList.Count - 1].line); }
public GradationWithButton(CriterionForm parent) { removeGrad = new ButtonWithParent(parent, this); Image img = new Image(); img.Source = new BitmapImage(new Uri(@"img/esc2.png", UriKind.RelativeOrAbsolute)); img.Width = 15; removeGrad.Content = img; removeGrad.Margin = new Thickness(10, 0, 0, 0); line.Children.Add(this.removeGrad); }
private void Button_Click_Remove_Form(object sender, RoutedEventArgs e) { CriterionForm parent = (sender as ButtonWithParent).criterionParent; if (parent.positive) { if (countPos > 1) { addCritPanel.Children.Remove(parent.border); criterionList.Remove(parent); countPos--; } } if (!parent.positive) { if (countNeg > 1) { addCritPanelNeg.Children.Remove(parent.border); criterionList.Remove(parent); countNeg--; } } }
private void Button_Click_Add_Critrrian(object sender, RoutedEventArgs e) { CriterionForm parent = (sender as ButtonWithParent).criterionParent; createForm(parent.positive); }
public ButtonWithParent(CriterionForm criterionParent, GradationWithButton gradationParent) { this.Style = (Style)Application.Current.Resources["Buttons"]; this.criterionParent = criterionParent; this.gradationParent = gradationParent; }