Microsoft.UI.Composition.Interactions Namespace

Provides functionality that enables input driven animations in the visual layer.



Allows conditional modification of the position and scale of a visual interaction source.


A collection of interaction sources.

This is the collection of interaction sources that are associated with a given InteractionTracker. The only valid member of this collection is a VisualInteractionSource. Each VisualInteractionSource needs to have a unique hit-test (source) visual. Each VisualInteractionSource will be configured individually for the desired input to be sent to the InteractionTracker.


Represents the configuration of a VisualInteractionSource input.


Handles the logic of input that can be used as targets in ExpressionAnimations—typically to drive the motion of visuals based on input.


Arguments for the IInteractionTrackerOwner.CustomAnimationStateEntered callback.


Arguments for the IInteractionTrackerOwner.IdleStateEntered callback.


Base class for inertia modifiers.

The InteractionTrackerInertiaModifier represents the base class for inertia modifiers. inertia modifiers can be thought of as ways to change the behavior for where and how InteractionTracker reaches its final resting position. Changing this behavior of InteractionTracker is commonly used when more custom motion experiences are needed such as snap points. There are two variations to how you can modify the behavior of InteractionTracker using inertia modifiers: modify its final resting position after interaction with the InteractionTrackerInertiaRestingValue class or define the equation used to calculate the actual motion and final resting position during Inertia with the InteractionTrackerInertiaMotion class. These modifiers are applied to either X Position, Y Position or Scale of InteractionTracker.


An ExpressionAnimation that defines motion of InteractionTracker during its inertia state.

The InteractionTrackerMotion class contains two ExpressionAnimation s representing a second derivative equation of position InteractionTracker will use to define the motion from the start to end of inertia when a particular condition is met. The InteractionTrackerMotion class is defined as two parts: The conditional statement to define when the motion will take place and the equation that describes the motion for how InteractionTracker will reach its final resting position. Utilize the InteractionTrackerInertiaMotion class when you need to define a customized motion (such as a spring motion) for InteractionTracker to use when in its inertia state.


A ScalarNaturalMotionAnimation that defines motion of InteractionTracker during its inertia state.


An ExpressionAnimation that defines the rest position after an interaction.

The InteractionTrackerInertiaRestingValue class defines two ExpressionAnimation s that calculate an explicit resting position for InteractionTracker when a particular condition is met. The InteractionTrackerInertiaRestingValue is defined as two parts: The conditional statement in which the InteractionTracker ’s specific resting location needs to be explicitly defined if true and the equation that describes a mathematical relationship that outputs the location. Utilize the InteractionTrackerInertiaRestingValue class when needing to ensure InteractionTracker lands on a specific location after an interaction occurs.


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.


Arguments for the IInteractionTrackerOwner.InteractingStateEntered callback.


Arguments for the IInteractionTrackerOwner.RequestIgnored callback.


Arguments for the IInteractionTrackerOwner.ValuesChanged callback.


Base class for InteractionTrackerVector2InertiaNaturalMotion.


A Vector2NaturalMotionAnimation that defines motion of InteractionTracker during its inertia state.


Object for configuring input to the InteractionTracker relative to a visual.

The VisualInteractionSource is designed to be used only with InteractionTracker and defines which input will be sent to the InteractionTracker to drive its state and properties. This class contains both the visual to be used for hit-testing, as well as a variety of configuration properties for which gestures and types of input will be sent to the InteractionTracker.



An object that is being tracked for interactions in the compositor.


Contains callbacks that will be triggered by InteractionTracker events.

Implementing this interface enables receiving callbacks regarding the state and values of the InteractionTracker, as well as whether requested updates to the InteractionTracker ’s properties are honored.



Defines constants that specify which axis is bound between two interaction trackers.


Defines the chaining behavior for a VisualInteractionSource. There are three options: Always chain, never chain or auto chain (let the system choose). If chaining is enabled, when an InteractionTracker reaches its minimum or maximum bounds, it will instead send the input to the next ancestor VisualInteractionSource.


Provides the various definitions for how a VisualInteractionSource will process interactions. Options available for the enumeration are Disabled , EnabledWithInertia and EnabledWithoutInertia . The InteractionSourceMode can be used to define the behavior for the X, Y and Scale Axis of a VisualInteractionSource.


Defines constants that specify whether an input should be redirected to the InteractionTracker.


Defines constants that specify how values are clamped when the InteractionTracker position is updated.


Defines constants that indicate whether an already running custom scale animation should be allowed to continue running.


Indicates what input should be redirected to the InteractionTracker.