private void child_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (child != null) { if (_keyMode == KeyMode.Ctrl) { (this.Child as ExtImage)?.SetCurrentBorderPoint(e.GetPosition(this.Child)); (this.Child as ExtImage)?.ResetBorderPoints(); OnBBoxesChanged.Invoke(); child.ReleaseMouseCapture(); this.Cursor = Cursors.Arrow; } else if (_keyMode == KeyMode.Shift) { } else if (_keyMode == KeyMode.Alt) { } else { child.ReleaseMouseCapture(); this.Cursor = Cursors.Arrow; } (this.Child as ExtImage)?.ResetBorderPoints(); this.Child?.InvalidateVisual(); } }
private void child_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (child != null) { if (_keyMode == KeyMode.Ctrl) { (this.Child as ExtImage)?.SetStartBorderPoint(e.GetPosition(this.Child)); this.Cursor = Cursors.Pen; child.CaptureMouse(); } else if (_keyMode == KeyMode.Shift) { (this.Child as ExtImage)?.ChangeClass(e.GetPosition(this.Child)); OnBBoxesChanged.Invoke(); } else if (_keyMode == KeyMode.Alt) { (this.Child as ExtImage)?.RemoveBBox(e.GetPosition(this.Child)); OnBBoxesChanged.Invoke(); } else { var tt = GetTranslateTransform(child); start = e.GetPosition(this); origin = new Point(tt.X, tt.Y); this.Cursor = Cursors.Hand; child.CaptureMouse(); } } }