public BezierCurveControl() { _points = new CurvePointList(this); _points.AddPoint(new Point(0, 1000)); _points.AddPoint(new Point(1000, 0)); InitializeComponent(); }
private void Canvas_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (_activePoint != null || e.RightButton == MouseButtonState.Pressed) { return; } var point = e.GetPosition((Canvas)sender); FloatingPoint.Visibility = Visibility.Collapsed; _activePoint = _points.AddPoint(point); _activePoint.Dot = new Path { Fill = Brushes.Blue, Stroke = Brushes.Blue, Data = new EllipseGeometry(point, 10, 10), }; _activePoint.Dot.MouseDown += _activePoint.OnMouseDown; _activeMin = _activePoint.GetMinValue(); _activeMax = _activePoint.GetMaxValue(); Graph.Children.Add(_activePoint.Dot); Canvas_Loaded(sender, null); }