次の方法で共有


ConnectedAnimation.SetAnimationComponent メソッド

定義

接続されたアニメーションの特定の部分のモーションを変更するカスタム CompositionAnimation を設定します。

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)

パラメーター

component
ConnectedAnimationComponent

変更する接続済みアニメーションの部分。

animation
ICompositionAnimationBase

既定のアニメーションの代わりに使用するアニメーション。

注釈

アニメーションを作成するときは、Composition 式文字列 "StartingValue" と "FinalValue" を使用して、システムの開始値と終了値を表します。 例:

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);

コンポジション式の使用方法の詳細については、「 式キーフレーム 」を参照してください。

適用対象