Table of Contents

Class ZoomPanControl

Namespace
SharpVectors.Runtime
Assembly
SharpVectors.Runtime.Wpf.dll

A class that wraps up zooming and panning of it's content.

public class ZoomPanControl : ContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IScrollInfo
Inheritance
ZoomPanControl
Implements
Inherited Members

Constructors

ZoomPanControl()

Fields

AnimationDurationProperty
ContentOffsetXProperty
ContentOffsetYProperty
ContentScaleProperty
ContentViewportHeightProperty
ContentViewportWidthProperty
ContentZoomFocusXProperty
ContentZoomFocusYProperty
IsMouseWheelScrollingEnabledProperty
MaxContentScaleProperty
MinContentScaleProperty
ViewportZoomFocusXProperty
ViewportZoomFocusYProperty

Properties

AnimationDuration

The duration of the animations (in seconds) started by calling AnimatedZoomTo and the other animation methods.

CanHorizontallyScroll

Set to 'true' when the vertical scrollbar is enabled.

CanVerticallyScroll

Set to 'true' when the vertical scrollbar is enabled.

ContentElement
ContentOffsetX

Get/set the X offset (in content coordinates) of the view on the content.

ContentOffsetY

Get/set the Y offset (in content coordinates) of the view on the content.

ContentScale

Get/set the current scale (or zoom factor) of the content.

ContentViewportHeight

Get the viewport height, in content coordinates.

ContentViewportWidth

Get the viewport width, in content coordinates.

ContentZoomFocusX

The X coordinate of the content focus, this is the point that we are focusing on when zooming.

ContentZoomFocusY

The Y coordinate of the content focus, this is the point that we are focusing on when zooming.

ExtentHeight

The height of the content (with 'ContentScale' applied).

ExtentWidth

The width of the content (with 'ContentScale' applied).

HorizontalOffset

The offset of the horizontal scrollbar.

IsMouseWheelScrollingEnabled

Set to 'true' to enable the mouse wheel to scroll the zoom and pan control. This is set to 'false' by default.

MaxContentScale

Get/set the maximum value for 'ContentScale'.

MinContentScale

Get/set the minimum value for 'ContentScale'.

ScrollOwner

Reference to the ScrollViewer that is wrapped (in XAML) around the ZoomPanControl. Or set to null if there is no ScrollViewer.

VerticalOffset

The offset of the vertical scrollbar.

ViewportHeight

Get the height of the viewport onto the content.

ViewportWidth

Get the width of the viewport onto the content.

ViewportZoomFocusX

The X coordinate of the viewport focus, this is the point in the viewport (in viewport coordinates) that the content focus point is locked to while zooming in.

ViewportZoomFocusY

The Y coordinate of the viewport focus, this is the point in the viewport (in viewport coordinates) that the content focus point is locked to while zooming in.

Methods

AnimatedScaleToFit()

Do animation that scales the content so that it fits completely in the control.

AnimatedSnapTo(Point)

Use animation to center the view on the specified point (in content coordinates).

AnimatedZoomAboutPoint(double, Point)

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).

AnimatedZoomTo(double)

Zoom in/out centered on the viewport center.

AnimatedZoomTo(double, Rect)

Do an animated zoom to view a specific scale and rectangle (in content coordinates).

AnimatedZoomTo(Rect)

Do an animated zoom to the specified rectangle (in content coordinates).

ArrangeOverride(Size)

Arrange the control and it's children.

LineDown()

Shift the content offset one line down.

LineLeft()

Shift the content offset one line left.

LineRight()

Shift the content offset one line right.

LineUp()

Shift the content offset one line up.

MakeVisible(Visual, Rect)

Bring the specified rectangle to view.

MeasureOverride(Size)

Measure the control and it's children.

MouseWheelDown()

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelLeft()

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelRight()

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelUp()

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

OnApplyTemplate()

Called when a template has been applied to the control.

PageDown()

Shift the content offset one page down.

PageLeft()

Shift the content offset one page left.

PageRight()

Shift the content offset one page right.

PageUp()

Shift the content offset one page up.

ScaleToFit()

Instantly scale the content so that it fits completely in the control.

SetHorizontalOffset(double)

Called when the offset of the horizontal scrollbar has been set.

SetVerticalOffset(double)

Called when the offset of the vertical scrollbar has been set.

SnapContentOffsetTo(Point)

Instantly center the view on the specified point (in content coordinates).

SnapTo(Point)

Instantly center the view on the specified point (in content coordinates).

ZoomAboutPoint(double, Point)

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).

ZoomTo(double)

Zoom in/out centered on the viewport center.

ZoomTo(Rect)

Instantly zoom to the specified rectangle (in content coordinates).

Events

ContentOffsetXChanged

Event raised when the ContentOffsetX property has changed.

ContentOffsetYChanged

Event raised when the ContentOffsetY property has changed.

ContentScaleChanged

Event raised when the ContentScale property has changed.