Exemple #1
0
 private void RemoveGraphFromCanvas(SerialGraph graph)
 {
     if (_graphCanvas != null && _graphCanvas.Children.Contains(graph))
     {
         _graphCanvas.Children.Remove(graph);
     }
 }
Exemple #2
0
 private void AddGraphToCanvas(SerialGraph graph)
 {
     if (_graphCanvas != null && !_graphCanvas.Children.Contains(graph))
     {
         _graphCanvas.Children.Add(graph);
     }
 }
Exemple #3
0
 private void RemoveIndicator(SerialGraph graph)
 {
     if (_graphCanvas != null)
     {
         _graphCanvas.Children.Remove(_indicators[graph]);
     }
     _indicators.Remove(graph);
 }
Exemple #4
0
        private static void OnValueMemberPathPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SerialGraph graph = d as SerialGraph;

            if (graph.ValueMemberPathChanged != null)
            {
                graph.ValueMemberPathChanged(graph, new DataPathEventArgs(e.NewValue as string));
            }
        }
Exemple #5
0
        private void AddIndicator(SerialGraph graph)
        {
            Indicator indicator = new Indicator();

            Binding fillBinding = new Binding("Brush");

            fillBinding.Source = graph;
            indicator.SetBinding(Indicator.FillProperty, fillBinding);

            Binding strokeBinding = new Binding("PlotAreaBackground");

            strokeBinding.Source = this;
            indicator.SetBinding(Indicator.StrokeProperty, strokeBinding);

#if WINDOWS_PHONE
            indicator.ManipulationStarted += new EventHandler <ManipulationStartedEventArgs>(OnIndicatorManipulationStarted);
#else
            indicator.MouseEnter += new MouseEventHandler(OnIndicatorMouseEnter);
            indicator.MouseLeave += new MouseEventHandler(OnIndicatorMouseLeave);
#endif

            _indicators.Add(graph, indicator);
            AddIndicatorToCanvas(indicator);
        }