CanZoom/Zom overrides in CustomCommandHandler

My custom command handler is not called (CanZoom and Zoom overrides) when using mouse wheel for zooming.

Zooming mouse wheel events call CommandHandler.IncreaseZoom or DecreaseZoom, not Zoom.

But you are right that DiagramTool.StandardMouseWheel, called by ToolManager.DoMouseWheel, does not call CommandHandler.CanIncreaseZoom or CanDecreaseZoom. So for now I suggest that your overrides of CommandHandler.IncreaseZoom and CommandHandler.DecreaseZoom do whatever additional checking that you want before (maybe) calling the base method.

The standard implementations check the DiagramPanel.MinimumScale and MaximumScale.

Thanks, but: These methods are called with null as parameter so I don’t now the amount of increase/decrease. Is it always 1?

Use CommandHandler.ZoomFactor for IncreaseZoom or 1/ZoomFactor for DecreaseZoom.