private void AddRectToStack(ComparisonGraphBar rect, bool positive, int index) { if (positive) { if (NegativeStack.Children.Contains(rect)) { NegativeStack.Children.Remove(rect); } if (!PositiveStack.Children.Contains(rect)) { PositiveStack.Children.Insert(index, rect); } } else { if (PositiveStack.Children.Contains(rect)) { PositiveStack.Children.Remove(rect); } if (!NegativeStack.Children.Contains(rect)) { NegativeStack.Children.Insert(index, rect); } } }
public void SetColors(IEnumerable <Color> colors) { rects = new List <ComparisonGraphBar>(); values = new List <float>(rects.Count); foreach (Color c in colors) { ComparisonGraphBar r = new ComparisonGraphBar() { Color = c }; r.Height = 30; r.Margin = new Thickness(0, 4, 0, 4); rects.Add(r); values.Add(0f); } }
private void AddRectToStack(ComparisonGraphBar rect, bool positive, int index) { if (positive) { if (NegativeStack.Children.Contains(rect)) NegativeStack.Children.Remove(rect); if (!PositiveStack.Children.Contains(rect)) PositiveStack.Children.Insert(index, rect); } else { if (PositiveStack.Children.Contains(rect)) PositiveStack.Children.Remove(rect); if (!NegativeStack.Children.Contains(rect)) NegativeStack.Children.Insert(index, rect); } }
public void SetColors(IEnumerable<Color> colors) { rects = new List<ComparisonGraphBar>(); values = new List<float>(rects.Count); foreach (Color c in colors) { ComparisonGraphBar r = new ComparisonGraphBar() { Color = c }; r.Height = 30; r.Margin = new Thickness(0, 4, 0, 4); rects.Add(r); values.Add(0f); } }