public void Clear(IChartView chart) { chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); TextBlock = null; Line = null; }
public void Clear(IChartView chart) { #if DEBUG Debug.WriteLine(((Canvas)chart.GetCanvas()).Children.Count); #endif chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); #if DEBUG Debug.WriteLine(((Canvas) chart.GetCanvas()).Children.Count); #endif TextBlock = null; Line = null; }
public void Clear(IChartView chart) { #if DEBUG Debug.WriteLine(((Canvas)chart.GetCanvas()).Children.Count); #endif chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); #if DEBUG Debug.WriteLine(((Canvas)chart.GetCanvas()).Children.Count); #endif TextBlock = null; Line = null; }
private void Remove(IChartView chart, Axis axis) { if (axis.DisableAnimations || chart.DisableAnimations) { chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); return; } if (TextBlock.Visibility == Visibility.Collapsed && Line.Visibility == Visibility.Collapsed) { return; } var anim = new DoubleAnimation { From = 1, To = 0, Duration = chart.AnimationsSpeed }; anim.Completed += (sender, args) => { if (Application.Current == null) { chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); return; } Application.Current.Dispatcher.Invoke(new Action(() => { chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); })); }; TextBlock.BeginAnimation(UIElement.OpacityProperty, anim); Line.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(1, 0, chart.AnimationsSpeed)); }
/// <summary> /// Clears the specified chart. /// </summary> /// <param name="chart">The chart.</param> public void Clear(IChartView chart) { chart.RemoveFromView(TextBlock); chart.RemoveFromView(Line); TextBlock = null; Line = null; }