public void InvokeNearestPointChanged(NearestPointEventArgs e) { EventHandler <NearestPointEventArgs> handler = NearestPointChanged; if (handler != null) { handler(this, e); } }
private void InvokePointClicked(NearestPointEventArgs e) { EventHandler <NearestPointEventArgs> handler = PointClicked; if (handler != null) { handler(this, e); } }
private void canvas_MouseMove(object sender, MouseEventArgs e) { NearestPointEventArgs nearestPointEventArgs = GetNearestPoint(e); pointMarker.Visibility = Visibility.Visible; var point = myLine.Points[nearestPointEventArgs.PointIndex]; Canvas.SetTop(pointMarker, point.Y - pointMarker.Height / 2); Canvas.SetLeft(pointMarker, point.X - pointMarker.Width / 2); InvokeNearestPointChanged(nearestPointEventArgs); }
private void canvas_MouseDown(object sender, MouseEventArgs e) { NearestPointEventArgs nearestPointEventArgs = GetNearestPoint(e); InvokePointClicked(nearestPointEventArgs); }
public void InvokeNearestPointChanged(NearestPointEventArgs e) { EventHandler<NearestPointEventArgs> handler = NearestPointChanged; if (handler != null) handler(this, e); }
private void InvokePointClicked(NearestPointEventArgs e) { EventHandler<NearestPointEventArgs> handler = PointClicked; if (handler != null) handler(this, e); }