private PointVisualObject CreatePoint() { var result = Point(plane.InMouseMagnetPosition).Style(FlatBrushes.Alizarin); m_createdPoints.Add(result); m_currentPoint = result; return(result); }
public void Cancel() { foreach (var point in m_createdPoints) { point.Destroy(); } m_currentPoint = null; if (m_current is Configuration current && !current.IsDisposed) { current.Cancel(); } }
private void Plane_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (e.OnlyPressed(MouseButton.Left) && m_currentPoint is PointVisualObject currentPoint) { if (plane.LastHitTestTop?.Owner is PointVisualObject) { m_createdPoints.Remove(currentPoint); m_currentPoint = null; } else { plane.Items.Add(currentPoint); } } }
private void Plane_MouseUp(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Released) { if (m_current?.IsDisposed ?? true) { m_currentPoint = null; m_createdPoints.Clear(); plane.EnableSelection = true; plane.RestoreCursor = null; } } plane.RenderChanged(); }