예제 #1
0
 public void Clear(IChartView chart)
 {
     chart.RemoveFromView(TextBlock);
     chart.RemoveFromView(Line);
     TextBlock = null;
     Line      = null;
 }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }
예제 #4
0
        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;
 }