Delen via


Timeline.AllowDependentAnimations Property

Definition

Gets or sets a value that determines whether dependent animations should be permitted to run, throughout the app.

public:
 static property bool AllowDependentAnimations { bool get(); void set(bool value); };
static bool AllowDependentAnimations();

static void AllowDependentAnimations(bool value);
public static bool AllowDependentAnimations { get; set; }
var boolean = Timeline.allowDependentAnimations;
Timeline.allowDependentAnimations = boolean;
Public Shared Property AllowDependentAnimations As Boolean

Property Value

Boolean

bool

true if animations can run in the app for dependent animation cases. Otherwise, false. The default is true.

Remarks

If you want to set this property value to false, do so as part of page or app initialization, for example in an app activation handler. The property is global for the app, and acts like an app setting, even if you set it in a page scope.

A false value for AllowDependentAnimations overrides all cases where EnableDependentAnimation is set to true on individual animations. When AllowDependentAnimations is false, no dependent animation will run in your app, they all act as if EnableDependentAnimation is false on all animations. For animations declared in the app's page XAML, it might seem that it wouldn't be necessary to disable the dependent animations because you have control over them already by not explicitly setting the EnableDependentAnimation properties. But the scenario for AllowDependentAnimations is more for app authors who are consuming controls with control templates that might contain dependent animations within them. Such animations might exist in the visual states, if the control authors didn't follow visual state best practices. (The control templates for default Windows Runtime controls don't have dependent animations, so you won't need to use AllowDependentAnimations if you're only using default XAML controls and default templates.)

Note

If you're using UIElement.CacheMode, you may have unintentionally created dependent animations, even when using default XAML controls; for more info, see UIElement.CacheMode and Optimize animations and media.

Applies to

See also