ConnectedAnimation.SetAnimationComponent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets a custom CompositionAnimation to change the motion of a particular part of the connected animation.
public:
virtual void SetAnimationComponent(ConnectedAnimationComponent component, ICompositionAnimationBase ^ animation) = SetAnimationComponent;
void SetAnimationComponent(ConnectedAnimationComponent const& component, ICompositionAnimationBase const& animation);
public void SetAnimationComponent(ConnectedAnimationComponent component, ICompositionAnimationBase animation);
function setAnimationComponent(component, animation)
Public Sub SetAnimationComponent (component As ConnectedAnimationComponent, animation As ICompositionAnimationBase)
Parameters
- component
- ConnectedAnimationComponent
The part of the connected animation to change.
- animation
- ICompositionAnimationBase
The animation to use in place of the default one.
Remarks
When creating the animation, use Composition expression strings "StartingValue" and "FinalValue" to represent the starting and ending values from the system. For example:
var customKeyFrameAnimation = Window.Compositor.CreateScalarKeyFrameAnimation();
customKeyFrameAnimation.Duration = ConnectedAnimationService.GetForCurrentView().DefaultDuration;
customKeyFrameAnimation.InsertExpressionKeyFrame(0.0f, "StartingValue");
customKeyFrameAnimation.InsertExpressionKeyFrame(0.5f, "FinalValue + 25");
customKeyFrameAnimation.InsertExpressionKeyFrame(1.0f, "FinalValue");
myConnectedAnimation.SetAnimationComponent(ConnectedAnimationComponent.OffsetX, customKeyFrameAnimation);
See Expression Keyframes for more information on using Composition expressions.