protected virtual void OnMouseWheel(object sender, MouseWheelEventArgs e) { double newAngle = CheckingAngle(RotateControl.Angle - changeAngleMouseWheel * Math.Sign(e.Delta)); if (RotateControl.Angle != newAngle && canRotate) { RequestRotateCommand?.Execute(newAngle); RequestEndRotateCommand?.Execute(newAngle); } }
protected virtual void OnMouseMove(object sender, MouseEventArgs e) { Vector currentMousePosition = e.MouseDevice.GetPosition(this) - centerImage; double changeAngle = Vector.AngleBetween(previousMousePosition, currentMousePosition) * mouseMoveFactor; newAngle = CheckingAngle(RotateControl.Angle + changeAngle); if (RotateControl.Angle != newAngle && canRotate) { RequestRotateCommand?.Execute(newAngle); } previousMousePosition = currentMousePosition; }
protected override void OnMouseWheel(object sender, MouseWheelEventArgs e) { double newAngle = RotateControl.Angle - numberDegreesInPosition * Math.Sign(e.Delta); if (maxAngle == 360) { newAngle = (newAngle + maxAngle) % maxAngle; } else if (newAngle > maxAngle) { newAngle = maxAngle; } else if (newAngle < 0) { newAngle = 0; } if (RotateControl.Angle != newAngle) { MainWindow.PlayerSwitcher.Play(); RequestRotateCommand?.Execute(newAngle); } }