InteractionTrackerInertiaRestingValue クラス

定義

相互作用後の残りの位置を定義する ExpressionAnimation

InteractionTrackerInertiaRestingValue クラスは、特定の条件が満たされたときに InteractionTracker の明示的な休止位置を計算する 2 つの ExpressionAnimationを定義します。 InteractionTrackerInertiaRestingValue は、2 つの部分として定義されます。 InteractionTracker の特定の休止場所が true の場合は明示的に定義する必要がある条件付きステートメントと、場所を出力する数学的リレーションシップを記述する数式です。 InteractionTracker が対話の発生後に特定の場所に到達することを確認する必要がある場合は、InteractionTrackerInertiaRestingValue クラスを利用します。

public ref class InteractionTrackerInertiaRestingValue sealed : InteractionTrackerInertiaModifier
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class InteractionTrackerInertiaRestingValue final : InteractionTrackerInertiaModifier
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class InteractionTrackerInertiaRestingValue : InteractionTrackerInertiaModifier
Public NotInheritable Class InteractionTrackerInertiaRestingValue
Inherits InteractionTrackerInertiaModifier
継承
Object Platform::Object IInspectable CompositionObject InteractionTrackerInertiaModifier InteractionTrackerInertiaRestingValue
属性

Windows の要件

デバイス ファミリ
Windows 10 Anniversary Edition (10.0.14393.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v3.0 で導入)

void MandatorySingleSnapPoints(ContainerVisual containerVisual, Visual contentVisual)
{
  //
  // Set up our inertia modifiers to behave as dmanip's "single mandatory" snap-points, at a
  // regular interval of 50px.
  //

  const float snapPointRange = 50.0f;

  //
  // Configure a "snap-point" to handle upward direction (to previous item).
  //

  var modifier1 = InteractionTrackerInertiaRestingValue.Create(_compositor);

  // Add a condition for when this upward “snap-point” applies.
  modifier1.Condition = _compositor.CreateExpressionAnimation(
    "this.Target.NaturalRestingPosition.y < " + 
    "(this.StartingValue - mod(this.StartingValue, snapPointRange) + snapPointRange / 2)");

  modifier1.Condition.SetScalarParameter("snapPointRange", snapPointRange);

  // Configure the resting spot when the condition is met 
  modifier1.EndPoint = _compositor.CreateExpressionAnimation(
    "this.StartingValue - mod(this.StartingValue, snapPointRange)");

  modifier1.EndPoint.SetScalarParameter("snapPointRange", snapPointRange);

  //
  // Configure a "snap-point" to handle downward direction (to next item).
  //

  var modifier2 = InteractionTrackerInertiaRestingValue.Create(_compositor);

  // Add a condition for when this downward “snap-point” applies.
  modifier2.Condition = _compositor.CreateExpressionAnimation(
    "this.Target.NaturalRestingPosition.y >= " + 
    "(this.StartingValue - mod(this.StartingValue, snapPointRange) + snapPointRange / 2)");

  modifier2.Condition.SetScalarParameter("snapPointRange", snapPointRange);

  // Configure the resting spot when the condition is met.
  modifier2.EndPoint = _compositor.CreateExpressionAnimation(
    "this.StartingValue + snapPointRange - mod(this.StartingValue, snapPointRange)");

  modifier2.EndPoint.SetScalarParameter("snapPointRange", snapPointRange);

  var modifiers = new InteractionTrackerInertiaRestingValue[] { modifier1, modifier2 };

  //
  // Add our "snap-point" inertia modifiers to the Y position of the InteractionTracker.
  //

  _tracker.ConfigurePositionYInertiaModifiers(modifiers);
}

注釈

InteractionTrackerInertiaRestingValue 修飾子を InteractionTracker にアタッチする場合は、X/Y Position または Scale に構成します。

条件プロパティを定義する ExpressionAnimation は、対話が完了 (指で解放) すると 1 回だけ実行され、RestingValue Expression はすべてのフレームで実行されます。

InteractionTrackerInertiaRestingValue 修飾子は、条件が満たされたときに InteractionTracker の休止位置を明示的に定義します。 ただし、この明示的な場所へのモーションは定義されません。システムはそれを処理します。 したがって、 InteractionTracker で特定のモーションを取得する必要があるが、正確な位置に移動する必要がない場合は、 InteractionTrackerInertiaMotion 修飾子を使用します。

プロパティ

Comment

CompositionObject に関連付ける文字列。

(継承元 CompositionObject)
Compositor

この CompositionObject の作成に使用されるコンポジター

(継承元 CompositionObject)
Condition

修飾子を適用するタイミングを記述する ExpressionAnimation

Condition プロパティは ExpressionAnimation で、 InteractionTracker が特定の静止位置を持つ必要があるタイミングを定義します。 この式は、相互作用が発生した後に 1 回実行され、型 Bool に解決する必要があります。それ以外の場合、条件が評価されるとエラーがスローされます。 式の作成の詳細については、「 ExpressionAnimation クラス」ページを参照してください。

Dispatcher

CompositionObject のディスパッチャー。

(継承元 CompositionObject)
DispatcherQueue

CompostionObject の DispatcherQueue を取得します。

(継承元 CompositionObject)
ImplicitAnimations

このオブジェクトにアタッチされた暗黙的なアニメーションのコレクション。

(継承元 CompositionObject)
Properties

CompositionObject に関連付けられているプロパティのコレクション。

(継承元 CompositionObject)
RestingValue

Condition プロパティの式が true の場合に InteractionTracker の残りの値を定義する ExpressionAnimation

Resting プロパティは ExpressionAnimation で、対応する条件が満たされた場合に相互作用後に InteractionTracker が移動する場所を示します。 InteractionTracker が慣性状態にあり、Float 型に解決する必要がある間、この式はフレームごとに実行されます。それ以外の場合は、式の評価時にエラーがスローされます。 式の作成の詳細については、「 ExpressionAnimation クラス」ページを参照してください。

メソッド

Close()

CompositionObject を閉じ、システム リソースを解放します。

(継承元 CompositionObject)
ConnectAnimation(String, CompositionAnimation)

接続とアニメーション。

(継承元 CompositionObject)
Create(Compositor)

InteractionTrackerInertiaRestingValue のインスタンスを作成します。

DisconnectAnimation(String)

アニメーションを切断します。

(継承元 CompositionObject)
Dispose()

アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。

(継承元 CompositionObject)
PopulatePropertyInfo(String, AnimationPropertyInfo)

アニメーション化できるプロパティを定義します。

(継承元 CompositionObject)
StartAnimation(String, CompositionAnimation)

アニメーションをオブジェクトの指定したプロパティに接続し、アニメーションを開始します。

(継承元 CompositionObject)
StartAnimation(String, CompositionAnimation, AnimationController)

アニメーションをオブジェクトの指定したプロパティに接続し、アニメーションを開始します。

(継承元 CompositionObject)
StartAnimationGroup(ICompositionAnimationBase)

アニメーション グループを開始します。

CompositionObject の StartAnimationGroup メソッドを使用すると、CompositionAnimationGroup を開始できます。 グループ内のすべてのアニメーションは、オブジェクトで同時に開始されます。

(継承元 CompositionObject)
StopAnimation(String)

指定したプロパティからアニメーションを切断し、アニメーションを停止します。

(継承元 CompositionObject)
StopAnimationGroup(ICompositionAnimationBase)

アニメーション グループを停止します。

(継承元 CompositionObject)
TryGetAnimationController(String)

指定したプロパティで実行されているアニメーションの AnimationController を返します。

(継承元 CompositionObject)

適用対象

こちらもご覧ください