예제 #1
0
        private void Grid_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            MouseIsDown                   = true;
            MouseDownPosition             = e.GetPosition(ImageGrid);
            SelectionRectangle.Visibility = Visibility.Visible;
            ChangeSelectionRectangle(MouseDownPosition, MouseDownPosition);

            ImageGrid.CaptureMouse();
        }
 private void ImageGrid_MouseDown(object sender, MouseButtonEventArgs e)
 {
     _mouseDown         = true;
     _mouseDownPosition = e.GetPosition(ImageGrid);
     ImageGrid.CaptureMouse();
     Console.WriteLine($"MouseDown Position: {_mouseDownPosition}");
     Canvas.SetLeft(CriteriaSelectionBox, _mouseDownPosition.X);
     Canvas.SetTop(CriteriaSelectionBox, _mouseDownPosition.Y);
     CriteriaSelectionBox.Width      = 0;
     CriteriaSelectionBox.Height     = 0;
     CriteriaSelectionBox.Visibility = Visibility.Visible;
 }