ArcGIS Pro 2.7 API Reference Guide
ScaleDuration(Double) Method
Example 

ArcGIS.Desktop.Mapping Namespace > Animation Class > ScaleDuration Method : ScaleDuration(Double) Method
The factor to scale by.
Adjust the length of the animation by a given scale factor.
Syntax
public void ScaleDuration( 
   double factor
)
Public Overloads Sub ScaleDuration( _
   ByVal factor As Double _
) 

Parameters

factor
The factor to scale by.
Example
Set the length of the animation.
public void SetAnimationLength(TimeSpan length)
{
  var mapView = MapView.Active;
  if (mapView != null)
    return;

  var animation = mapView.Map.Animation;
  var duration = animation.Duration;
  if (duration == TimeSpan.Zero)
    return;

  var factor = length.TotalSeconds / duration.TotalSeconds;
  animation.ScaleDuration(factor);
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Animation Class
Animation Members
Overload List