New to Telerik UI for WPFStart a free 30-day trial

Represents an abstract base class for creating animations in a user interface. The RadAnimation class provides properties to define the name, repeat behavior, and speed ratio of an animation, along with methods to create and update animations for UI controls. Derived classes should implement the CreateAnimation method to generate specific animations, while the UpdateAnimation method can be overridden to adjust the timing and behavior of the storyboard before playback. This class serves as the foundation for animation management in UI applications, allowing for flexible and reusable animation logic.

Definition

Namespace:Telerik.Windows.Controls.Animation

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public abstract class RadAnimation

Inheritance: objectRadAnimation

Derived Classes: AnimationGroupBaseAnimationExpandCollapseAnimationTreeViewExpandCollapseAnimationAngleRangeAnimationRadiusFactorAnimationTimelineResizeAnimation...

Constructors

C#
protected RadAnimation()

Properties

Gets or sets the name of the animation.

C#
public string AnimationName { get; set; }
Remarks:

This property is used by the NamedAnimationSelector to identify the correct animation to return.

It is not used outside the NamedAnimationSelector

Gets or sets a value indicating whether the animation should automatically reverse its direction upon completion.

C#
public bool AutoReverse { get; set; }

RepeatBehavior

RepeatBehavior

Gets or sets the value for the RepeatBehavior of the animation.

C#
public RepeatBehavior RepeatBehavior { get; set; }

Gets or sets the value for the SpeedRatio of the Storyboard generated by this animation.

C#
public double SpeedRatio { get; set; }

Methods

When overridden in a derived class this method is called when the animation for an instance of a control needs to be created.

C#
public abstract Storyboard CreateAnimation(FrameworkElement control)
Parameters:controlFrameworkElement

The control for which the animation is needed.

Returns:

Storyboard

The newly created animation.

When overridden in a derived class this method updates the animation before it is played.

C#
public virtual void UpdateAnimation(FrameworkElement control, Storyboard storyboard, params object[] args)
Parameters:controlFrameworkElement

The control for which the animation needs to be updated.

storyboardStoryboard

Storyboard that needs to be updated.

argsobject[]

A set of arguments used for animation creation.

Remarks:

Currently the method sets the SpeedRatio of the storyboard to the global AnimationSpeedRatio if the local SpeedRatio is null. If the local SpeedRatio value is set, it will be used.