This guide covers the knobs that make ZoomBorder feel predictable in real applications.
BoundsMode controls how the viewport is constrained:
UnrestrictedKeepContentVisibleFillViewportKeepCenteredCustomAdditional supporting properties:
BoundsPaddingMinimumVisibleContentPercentageEnableConstrainsUse Custom when a subclass overrides GetContentBounds() or ValidateTransform(...). The returned rectangle is expressed in child content coordinates and drives both pan constraints and logical scrollbar extent. See Custom Bounds, Resize, and Rotation for a large-workspace example.
Wheel input is configurable instead of being hard-coded:
zoomBorder.WheelBehavior = WheelBehaviorMode.Zoom;
zoomBorder.WheelWithCtrl = WheelBehaviorMode.Zoom;
zoomBorder.WheelWithShift = WheelBehaviorMode.PanHorizontal;
zoomBorder.WheelZoomSensitivity = 1.0;
zoomBorder.WheelPanSensitivity = 1.0;
This is useful when a surface needs horizontal scrolling, precision zoom, or different modifier semantics.
Resize handling is controlled by ResizeBehavior:
NoneMaintainCenterMaintainTopLeftMaintainZoomReapplyStretchCustomChoose ReapplyStretch when the control should behave like a viewer that always re-fits content after host layout changes.
Auto-calculated zoom limits are available through:
AutoCalculateMinZoomAutoCalculateMaxZoomMaxZoomPixelSizeThat keeps very small or very large content usable without manually tuning MinZoomX, MaxZoomX, MinZoomY, and MaxZoomY for every surface.