Click or drag to resize

ZoomPanelZoomPanelAnimator Field

Gets or sets a class that is used to animate the ZoomPanel. Default value is ZoomPanelQuinticAnimator that adds some easing to animation.

Namespace:  Ab2d.Controls
Assembly:  Ab2d.Controls.ZoomPanel (in Ab2d.Controls.ZoomPanel.dll) Version: 5.2.6631.1040
Syntax
C#
public BaseZoomPanelAnimator ZoomPanelAnimator

Field Value

Type: BaseZoomPanelAnimator
Remarks

By default the ZoomPanelAnimator is set to ZoomPanelQuinticAnimator. This animator provides some animation easing.

To use simple linear animation use the ZoomPanelLinearAnimator class.

It is possible to provide custom animations with deriving a class from BaseZoomPanelAnimator and setting its instance to the ZoomPanelAnimator property.

The classes that derive from BaseZoomPanelAnimator must override abstract CalculateValue method. Additional animation customizations are possible with overriding the CalculateViewboxAndRotationAngle method.

Examples

The following class defines a simple sine animation:

public class ZoomPanelSineAnimator : BaseZoomPanelAnimator
{
    public override double CalculateValue(double startValue, double endValue, double progress)
    {
        double middleValue = (endValue - startValue) / 2;

        if (progress < 0.5)
            return (1 - Math.Cos(progress * Math.PI)) * middleValue + startValue;
        else
            return Math.Sin((progress - 0.5) * Math.PI) * middleValue + startValue + middleValue;
    }
}
See Also