PanAndZoom offers three levels of state management.
Current state is available through properties such as:
ZoomX, ZoomYOffsetX, OffsetYRotationStretchThese are the values you bind into status bars or diagnostics panels.
When EnableViewHistory is enabled, navigation APIs record viewport changes:
NavigateBack(...)NavigateForward(...)ClearViewHistory()CanNavigateBackCanNavigateForwardThis is intended for undo-like viewport navigation rather than full application undo stacks.
Two features support longer-lived persistence:
SaveView(...), RestoreView(...), GetSavedViews()ExportState() and ImportState(...)Avalonia.Controls.PanAndZoom.ZoomBorderState is the broadest persistence payload and is the right choice when you need to store or transmit a complete viewport configuration.