HypernovaDesktop Components · docs
Binarymission
WPFPan And Zoom Provider › ZoomPanControl

ZoomPanControl

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.ContentControls

A custom class that provides zoom and pan features for any FrameworkElement.

public class ZoomPanControl : ContentControl

Inherits from / implements: ContentControl

Members at a glance

ZoomPanControlInitializes a new instance of the ZoomPanControl class.
AutomaticZoomOutKeyGets or sets the Key that will be enable automatic zooming out, when the user hits that specific Key. By default this key is Escape key.
IsAutomaticZoomingoutByKeypressEnabledGets or sets whether the user will be able to zoom out in full (if he is in zoomed in mode currently) by hitting a specified key (Escape key by default).
IsPanningEnabledGets or sets as to whether the control should support pan as well as zoom or just zoom.
ZoomInKeyboardKeyGets or sets the Keyboard key to perform "Zoom In" function.
ZoomMaximumDepthGets or sets the maximum zoom you would want the Zooming service to support.
ZoomMinimumDepthGets or sets the minimum zoom you would want the Zooming service to support.
ZoomOutKeyboardKeyGets or sets the Keyboard key to perform "Zoom In" function.
ZoomStepGets or sets the zoom factor for zooming the serviced target object - i.e. the Content.
OnApplyTemplateCalled once the control template has been applied, which is where the named parts of the template first become reachable.
AutomaticZoomOutKeyPropertyIdentifies the AutomaticZoomOutKey dependency property.
IsAutomaticZoomingoutByKeypressEnabledPropertyIdentifies the IsAutomaticZoomingoutByKeypressEnabled dependency property.
IsPanningEnabledPropertyIdentifies the IsPanningEnabled dependency property.
ZoomInKeyboardKeyPropertyIdentifies the ZoomInKeyboardKey dependency property.
ZoomMaximumDepthPropertyIdentifies the ZoomMaximumDepth dependency property.
ZoomMinimumDepthPropertyIdentifies the ZoomMinimumDepth dependency property.
ZoomOutKeyboardKeyPropertyIdentifies the ZoomOutKeyboardKey dependency property.
ZoomStepPropertyIdentifies the ZoomStep dependency property.

Constructors

ZoomPanControl

public ZoomPanControl()

Initializes a new instance of the ZoomPanControl class.

Properties

AutomaticZoomOutKey

public Key AutomaticZoomOutKey

Gets or sets the Key that will be enable automatic zooming out, when the user hits that specific Key. By default this key is Escape key.

IsAutomaticZoomingoutByKeypressEnabled

public bool IsAutomaticZoomingoutByKeypressEnabled

Gets or sets whether the user will be able to zoom out in full (if he is in zoomed in mode currently) by hitting a specified key (Escape key by default).

IsPanningEnabled

public bool IsPanningEnabled

Gets or sets as to whether the control should support pan as well as zoom or just zoom.

By default, panning is enabled.

ZoomInKeyboardKey

public Key ZoomInKeyboardKey

Gets or sets the Keyboard key to perform "Zoom In" function.

By default, this is set to Up (Arrow Up) key.

ZoomMaximumDepth

public double ZoomMaximumDepth

Gets or sets the maximum zoom you would want the Zooming service to support.

ZoomMinimumDepth

public double ZoomMinimumDepth

Gets or sets the minimum zoom you would want the Zooming service to support.

ZoomOutKeyboardKey

public Key ZoomOutKeyboardKey

Gets or sets the Keyboard key to perform "Zoom In" function.

By default, this is set to Down (Arrow Down) key.

ZoomStep

public double ZoomStep

Gets or sets the zoom factor for zooming the serviced target object - i.e. the Content.

This factor will determine how much of zoom to apply for every mouse wheel move unit of zoom attempt by the user.

Methods

OnApplyTemplate

public override void OnApplyTemplate()

Called once the control template has been applied, which is where the named parts of the template first become reachable.

Fields

AutomaticZoomOutKeyProperty

public static readonly DependencyProperty AutomaticZoomOutKeyProperty

Identifies the AutomaticZoomOutKey dependency property.

IsAutomaticZoomingoutByKeypressEnabledProperty

public static readonly DependencyProperty IsAutomaticZoomingoutByKeypressEnabledProperty

Identifies the IsAutomaticZoomingoutByKeypressEnabled dependency property.

IsPanningEnabledProperty

public static readonly DependencyProperty IsPanningEnabledProperty

Identifies the IsPanningEnabled dependency property.

ZoomInKeyboardKeyProperty

public static readonly DependencyProperty ZoomInKeyboardKeyProperty

Identifies the ZoomInKeyboardKey dependency property.

ZoomMaximumDepthProperty

public static readonly DependencyProperty ZoomMaximumDepthProperty

Identifies the ZoomMaximumDepth dependency property.

ZoomMinimumDepthProperty

public static readonly DependencyProperty ZoomMinimumDepthProperty

Identifies the ZoomMinimumDepth dependency property.

ZoomOutKeyboardKeyProperty

public static readonly DependencyProperty ZoomOutKeyboardKeyProperty

Identifies the ZoomOutKeyboardKey dependency property.

ZoomStepProperty

public static readonly DependencyProperty ZoomStepProperty

Identifies the ZoomStep dependency property.