protected override void OnMouseMove(MouseEventArgs arg) { ModalController controller = MainWindow.mainWindow.currentController; if (dragMode) { scrollByDrag(arg); } else { if (controller != null) { Point ab = drawer.fromClientToAB(arg.X, arg.Y); controller.onMouseMove(this, drawer.fromABToXYZ(ab, controller), ab); } } }
private void MouseButtonUp(object sender, MouseButtonEventArgs e) { if (dragMode) { dragMode = false; Mouse.MousePosition = new Point(oldX, oldY); Mouse.ShowCursor = true; } if (lastMouseState) { if (controller != null) { Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); Location xyz = qView.fromABToXYZ(ab, controller); if (e.Button == MouseButton.PrimaryButton) { controller.OnClick(null, xyz, ab); } } } lastMouseState = e.ButtonPressed; }