Exemplo n.º 1
0
 private void MouseRelease(object sender, MouseButtonEventArgs e)
 {
     ClickPoint      = null;
     ShapeToEdit     = null;
     IsProcessing    = false;
     SelectedLineDim = null;
 }
Exemplo n.º 2
0
 private void MouseClick(object sender, MouseButtonEventArgs e)
 {
     IsProcessing = true;
     if (SelectedEditMode == EditModes.Draw)
     {
         ClickPoint = e.GetPosition(canvas);
         DrawNewShape((int)ClickPoint.Value.X, (int)ClickPoint.Value.Y);
     }
     else if (SelectedEditMode == EditModes.Resize && ShapeToEdit != null)
     {
         ClickPoint = new Point((int)Canvas.GetLeft(ShapeToEdit), (int)Canvas.GetTop(ShapeToEdit));
     }
     else if (SelectedEditMode == EditModes.Drag && ShapeToEdit != null)
     {
         ClickPoint = e.GetPosition(canvas);
         if (ShapeToEdit.GetType() == typeof(Line))
         {
             SelectedLineDim = new LineDimensions((Line)ShapeToEdit);
             return;
         }
         SelectedShapeDim = new ShapeDimensions(ShapeToEdit);
     }
 }