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