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