/// <inheritdoc /> public virtual void OnMouseWheelMoved(MouseWheelMovedEvent e) { }
// Called when the mouse wheel is rotated public override void OnMouseWheelMoved(MouseWheelMovedEvent e) { // If the wheel rotation is negative it means that it is moved forward. // Set move direction = forward, if wheel is moved forward. // Otherwise, set move direction = backward moveDirection = (e.WheelRotation < 0) ? 1 : -1; // Set the amount to move = absolute wheel rotation amount * 5 (speed) // Here 5 means 5 pixels per wheel rotation step. The higher value, the // more speed moveAmount += Math.Abs(e.WheelRotation)*5; }