InteractionTracker.ConfigurePositionXInertiaModifiers Method

Definition

Applies a collection of InteractionTrackerInertiaModifier objects to the x inertia of an InteractionTracker.

The ConfigurePositionXInertiaModifiers method applies an individual or a collection of InteractionTrackerInertiaModifiers to the x component of InteractionTracker. The system will evaluate each of X modifier's condition property in the order they were added to InteractionTracker. Thus, the order that the InteractionTrackerInertiaModifier have in the collection will be the same order that the system will evaluate with.

public:
 virtual void ConfigurePositionXInertiaModifiers(IIterable<InteractionTrackerInertiaModifier ^> ^ modifiers) = ConfigurePositionXInertiaModifiers;
void ConfigurePositionXInertiaModifiers(IIterable<InteractionTrackerInertiaModifier> const& modifiers);
public void ConfigurePositionXInertiaModifiers(IEnumerable<InteractionTrackerInertiaModifier> modifiers);
function configurePositionXInertiaModifiers(modifiers)
Public Sub ConfigurePositionXInertiaModifiers (modifiers As IEnumerable(Of InteractionTrackerInertiaModifier))

Parameters

modifiers

IIterable<InteractionTrackerInertiaModifier>

IEnumerable<InteractionTrackerInertiaModifier>

The collection of InteractionTrackerInertiaModifier objects to apply to the x inertia of an InteractionTracker.

Examples

void SimpleXModifer(CompositionPropertySet shared)
{
  // Create the Inertia Modifier for X Direction.
  var xModifier = InteractionTrackerInertiaRestingValue.Create(_compositor);

  // For sample purpose, always true condition
  xModifier.Condition = _compositor.CreateExpressionAnimation("5 > 3");
  xModifier.RestingValue = _compositor.CreateExpressionAnimation("this.Target.Position.X - shared.snapRangeX");
  xModifier.RestingValue.SetReferenceParameter("shared", _sharedDelta);
  var xModifierList = new InteractionTrackerInertiaRestingValue[] { xModifier };

  // Add modifier list to InteractionTracker.
  _tracker.ConfigurePositionXInertiaModifiers(xModifierList); 
}

Remarks

If you have a dependency on the system evaluating the inertia modifiers in a particular order, ensure that they are inserted into the list (if multiple) or into InteractionTracker directly (if single) in the order you want them evaluated. The system will evaluate the conditions of the inertia modifiers in the order they are inserted.

Applies to