Exemplo n.º 1
0
        private static void OnValuesInstanceChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            var series = (Series)dependencyObject;

            if (series.Values != series.LastKnownValues && series.LastKnownValues != null)
            {
                series.LastKnownValues.Points.ForEach(x => x.View.RemoveFromView(series.Model.Chart));
            }

            CallChartUpdater()(dependencyObject, dependencyPropertyChangedEventArgs);
            series.LastKnownValues = series.Values;
        }
Exemplo n.º 2
0
        private static void UpdateChartFrequency(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            var wpfChart = (Chart)o;

            var freq = wpfChart.DisableAnimations ? TimeSpan.FromMilliseconds(10) : wpfChart.AnimationsSpeed;

            if (wpfChart.Model == null || wpfChart.Model.Updater == null)
            {
                return;
            }

            wpfChart.Model.Updater.UpdateFrequency(freq);

            CallChartUpdater(true)(o, e);
        }
Exemplo n.º 3
0
        private static void OnSeriesChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            var chart = (Chart)dependencyObject;

            if (chart.LastKnownSeriesCollection != chart.Series && chart.LastKnownSeriesCollection != null)
            {
                foreach (var series in chart.LastKnownSeriesCollection)
                {
                    series.Erase();
                }
            }

            CallChartUpdater()(dependencyObject, dependencyPropertyChangedEventArgs);
            chart.LastKnownSeriesCollection = chart.Series;
        }
Exemplo n.º 4
0
        private static void OnValuesInstanceChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            var series = (Series)dependencyObject;

            if (series.Values != series.LastKnownValues && series.LastKnownValues != null)
            {
                series.LastKnownValues.GetPoints(series).ForEach(
                    x => { if (x.View != null)
                           {
                               x.View.RemoveFromView(series.Model.Chart);
                           }
                    });
            }

            CallChartUpdater()(dependencyObject, dependencyPropertyChangedEventArgs);
            series.LastKnownValues = series.Values;
            var quePedo = series.LastKnownValues.GetHashCode() == series.Values.GetHashCode();
        }
Exemplo n.º 5
0
        private static void OnSeriesChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            var chart = (Chart)o;

            if (chart.Series != null)
            {
                chart.Series.Chart = chart.Model;
                foreach (var series in chart.Series)
                {
                    series.Model.Chart = chart.Model;
                }
            }

            if (chart.LastKnownSeriesCollection != chart.Series && chart.LastKnownSeriesCollection != null)
            {
                foreach (var series in chart.LastKnownSeriesCollection)
                {
                    series.Erase();
                }
            }

            CallChartUpdater()(o, e);
            chart.LastKnownSeriesCollection = chart.Series;
        }