Example #1
0
        private PointVisualObject CreatePoint()
        {
            var result = Point(plane.InMouseMagnetPosition).Style(FlatBrushes.Alizarin);

            m_createdPoints.Add(result);
            m_currentPoint = result;
            return(result);
        }
Example #2
0
 public void Cancel()
 {
     foreach (var point in m_createdPoints)
     {
         point.Destroy();
     }
     m_currentPoint = null;
     if (m_current is Configuration current && !current.IsDisposed)
     {
         current.Cancel();
     }
 }
Example #3
0
 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);
         }
     }
 }
Example #4
0
        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();
        }