public void Remove(string input) { int index = ChartInputs.IndexOf(input); ChartInputs.RemoveAt(index); Ellipses.RemoveAt(index); Lines.RemoveAt(index); WrapItems.Children.RemoveAt(index); /*foreach(StackPanel item in WrapItems.Children) * { * if((item.Children[0] as TextBlock).Text == input) * { * WrapItems.Children.Remove(item); * break; * } * }*/ }
public void Add(string name, Brush ellipse, Brush line) { ChartInputs.Add(name); Ellipses.Add(ellipse); Lines.Add(line); StackPanel Items = new StackPanel() { Margin = new Thickness() { Left = 5, Right = 5 }, Orientation = Orientation.Vertical, Children = { CreateTextBlock(name), CreateTextBox(name) } }; WrapItems.Children.Add(Items); }