private void MainGrid_MouseDown(object sender, MouseButtonEventArgs e)
{
// Get the mouse click position relative to the mainGrid
Point clickPosition = e.GetPosition(mainGrid);
// Show a dot at the click position
ShowDot(dotEnd, clickPosition);
}
private void ShowDot(Ellipse dot, Point position)
{
dot.Margin = new Thickness(position.X - dot.Width / 2, position.Y - dot.Height / 2, 0, 0);
// Show the dot
dot.Visibility = Visibility.Visible;
}
private void MainGrid_MouseDown(object sender, MouseButtonEventArgs e)
{
// Get the mouse click position relative to the mainGrid
Point clickPosition = e.GetPosition(mainGrid);
// Show a dot at the click position
ShowDot(dotEnd, clickPosition);
}
private void ShowDot(Ellipse dot, Point position)
{
dot.Margin = new Thickness(position.X - dot.Width / 2, position.Y - dot.Height / 2, 0, 0);
// Show the dot
dot.Visibility = Visibility.Visible;
}