-api-id | -api-type |
---|---|
T:Windows.UI.Composition.Interactions.InteractionTrackerInertiaStateEnteredArgs |
winrt class |
Arguments for the IInteractionTrackerOwner.InertiaStateEntered callback.
The InteractionTrackerOwner.InertiaStateEntered class defines the accessible and up-to-date property values when InteractionTracker enters the inertia state. If registered for the InertiaStateEntered event, values of this object's properties represent the results calculated by the system at the beginning of the inertia state. Using the modified and natural resting positions helps enables scenarios such as scrolling virtualization.
Windows version | SDK version | Value added |
---|---|---|
1809 | 17763 | IsInertiaFromImpulse |
1903 | 18362 | IsFromBinding |
public void InertiaStateEntered(InteractionTracker sender, InteractionTrackerInertiaStateEnteredArgs args)
{
// Natural and Modified Resting Positions and Scale
Vector3 naturalRestPos = args.NaturalRestingPosition;
Vector3 modifiedRestPos = (Vector3)args.ModifiedRestingPosition;
float naturalRestScale = args.NaturalRestingScale;
float modifiedRestScale = (float) args.ModifiedRestingScale;
// Position and Scale velocity of InteractionTracker when entering Inertia
Vector3 posVelocity = args.PositionVelocityInPixelsPerSecond;
float scaleVelocity = args.ScaleVelocityInPercentPerSecond;
// The ID for the request that triggered the callback
int id = args.RequestId;
}