コード例 #1
0
        private static void OnPointSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataFollowChart chart = (DataFollowChart)d;

            PointsGraphBase previous = e.OldValue as PointsGraphBase;

            if (previous != null)
            {
                previous.VisiblePointsChanged -= chart.Source_VisiblePointsChanged;
            }

            PointsGraphBase current = e.NewValue as PointsGraphBase;

            if (current != null)
            {
                current.ProvideVisiblePoints  = true;
                current.VisiblePointsChanged += chart.Source_VisiblePointsChanged;
                if (current.VisiblePoints != null)
                {
                    chart.searcher = new SortedXSearcher1d(current.VisiblePoints);
                }
            }

            chart.UpdateUIRepresentation();
        }
コード例 #2
0
        private static void OnMarkerTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataFollowChart chart    = (DataFollowChart)d;
            DataTemplate    template = (DataTemplate)e.NewValue;

            FrameworkElement marker;

            if (template != null)
            {
                marker = (FrameworkElement)template.LoadContent();
            }
            else
            {
                marker = CreateDefaultMarker();
            }

            chart.Children.Remove(chart.marker);
            chart.Marker = marker;
            chart.Children.Add(marker);
        }
コード例 #3
0
        private static void OnMarkerPositionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataFollowChart chart = (DataFollowChart)d;

            chart.MarkerPositionChanged.Raise(chart);
        }