public IEnumerable <SimpleLineChart> FindCharts() { foreach (UIElement e in Snapshot(theStack.Children)) { SimpleLineChart chart = e as SimpleLineChart; if (chart != null) { yield return(chart); } ChartGroup group = e as ChartGroup; if (group != null) { foreach (SimpleLineChart child in group.FindCharts()) { yield return(child); } } } }
public void RemoveChart(SimpleLineChart e) { if (e.Parent == theStack) { theStack.Children.Remove(e); } else if (e.Parent is ChartGroup) { // it's a chart group then. ChartGroup group = (ChartGroup)e.Parent; group.Children.Remove(e); SimpleLineChart chart = e as SimpleLineChart; if (chart != null) { chart.Group = null; } if (group.Children.Count == 0) { theStack.Children.Remove(group); } group.InvalidateCharts(); } }
internal void AddChartGroup(ChartGroup chartGroup) { theStack.Children.Add(chartGroup); }