Exemple #1
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);
    }
Exemple #2
0
 private void AddGraphToCanvas(SerialGraph graph) {
   if (_graphCanvas != null && !_graphCanvas.Children.Contains(graph)) {
     _graphCanvas.Children.Add(graph);
   }
 }
Exemple #3
0
 private void RemoveGraphFromCanvas(SerialGraph graph) {
   if (_graphCanvas != null && _graphCanvas.Children.Contains(graph))
     _graphCanvas.Children.Remove(graph);
 }
Exemple #4
0
 private void RemoveIndicator(SerialGraph graph) {
   if (_graphCanvas != null) {
     _graphCanvas.Children.Remove(_indicators[graph]);
   }
   _indicators.Remove(graph);
 }