MouseBinding the mousewheel to zoom in WPF and MVVM

the real anwser is to write your own MouseGesture, which is easy.

<MouseBinding Gesture="{x:Static me:MouseWheelGesture.CtrlDown}"  
              Command="me:MainVM.SendBackwardCommand" />
public class MouseWheelGesture : MouseGesture
{
    public MouseWheelGesture() : base(MouseAction.WheelClick)
    {
    }

    public MouseWheelGesture(ModifierKeys modifiers) : base(MouseAction.WheelClick, modifiers)
    {
    }

    public static MouseWheelGesture CtrlDown =>
        new(ModifierKeys.Control) { Direction = WheelDirection.Down };

    public WheelDirection Direction { get; set; }

    public override bool Matches(object targetElement, InputEventArgs inputEventArgs) =>
        base.Matches(targetElement, inputEventArgs)
        && inputEventArgs is MouseWheelEventArgs args
        && Direction switch
        {
            WheelDirection.None => args.Delta == 0,
            WheelDirection.Up => args.Delta > 0,
            WheelDirection.Down => args.Delta < 0,
            _ => false,
        };
}

public enum WheelDirection
{
    None,
    Up,
    Down,
}

I would suggest that you implement a generic zoom command in your VM. The command can be parameterized with a new zoom level, or (perhaps even simpler) you could implement an IncreaseZoomCommand and DecreaseZoomCommand. Then use the view's code behind to call these commands after you have processed the event arguments of the Mouse Wheel event. If the delta is positive, zoom in, if negative zoom out.

There is no harm in solving this problem by using a few lines of code behind. The main idea of MVVM is that, you are able to track and modify nearly the complete state of your view in an object that does not depend on the UI (enhances the testability). In consequence, the calculation of the new viewport which is the result of the zoom should be done in the VM and not in code behind.

The small gap of testability that exists in the code behind can either be disregarded or covered by automatic UI tests. Automatic UI tests, however, can be very expensive.