Skip to content

Instantly share code, notes, and snippets.

@dupuyjs
Last active March 4, 2016 17:23
Show Gist options
  • Save dupuyjs/54c6eca3065216e837fd to your computer and use it in GitHub Desktop.
Save dupuyjs/54c6eca3065216e837fd to your computer and use it in GitHub Desktop.
Visual Layer - Expression Animations
#region Expression Animations
ExpressionAnimation expressionAnimation = _compositor.CreateExpressionAnimation();
expressionAnimation.Expression = "foreground.RotationAngleInDegrees < 180 ? background.Offset.X + 4.0f : background.Offset.X - 4.0f";
expressionAnimation.SetReferenceParameter("background", background);
expressionAnimation.SetReferenceParameter("foreground", foreground);
background.StartAnimation("Offset.X", expressionAnimation);
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment