Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 2.42 KB

interactiontracker_configurepositionxinertiamodifiers_1194364155.md

File metadata and controls

48 lines (32 loc) · 2.42 KB
-api-id -api-type
M:Windows.UI.Composition.Interactions.InteractionTracker.ConfigurePositionXInertiaModifiers(Windows.Foundation.Collections.IIterable{Windows.UI.Composition.Interactions.InteractionTrackerInertiaModifier})
winrt method

Windows.UI.Composition.Interactions.InteractionTracker.ConfigurePositionXInertiaModifiers

-description

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.

-parameters

-param modifiers

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

-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.

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

-see-also