次の方法で共有


InteractionTrackerInertiaRestingValue クラス

定義

操作後の残りの位置を定義する ExpressionAnimation

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

public ref class InteractionTrackerInertiaRestingValue sealed : InteractionTrackerInertiaModifier
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [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.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
class InteractionTrackerInertiaRestingValue final : InteractionTrackerInertiaModifier
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class InteractionTrackerInertiaRestingValue : InteractionTrackerInertiaModifier
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public sealed class InteractionTrackerInertiaRestingValue : InteractionTrackerInertiaModifier
Public NotInheritable Class InteractionTrackerInertiaRestingValue
Inherits InteractionTrackerInertiaModifier
継承
Object Platform::Object IInspectable CompositionObject InteractionTrackerInertiaModifier InteractionTrackerInertiaRestingValue
属性

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 位置またはスケールに構成します。

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

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

プロパティ

Comment

CompositionObject に関連付ける文字列。

(継承元 CompositionObject)
Compositor

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

(継承元 CompositionObject)
Condition

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

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

DispatcherQueue

CompositionObject の DispatcherQueue を取得します。

(継承元 CompositionObject)
ImplicitAnimations

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

(継承元 CompositionObject)
Properties

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

(継承元 CompositionObject)
RestingValue

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

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

メソッド

Close()

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

(継承元 CompositionObject)
Create(Compositor)

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

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)

適用対象

こちらもご覧ください