Share via


InteractionSourceMode Enum

Definition

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.

public enum class InteractionSourceMode
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
enum class InteractionSourceMode
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
enum class InteractionSourceMode
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
public enum InteractionSourceMode
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public enum InteractionSourceMode
var value = Microsoft.UI.Composition.Interactions.InteractionSourceMode.disabled
Public Enum InteractionSourceMode
Inheritance
InteractionSourceMode
Attributes

Fields

Name Value Description
Disabled 0

Interaction is disabled.

EnabledWithInertia 1

Interaction is enabled with inertia.

EnabledWithoutInertia 2

Interaction is enabled without inertia.

Examples

void SetupInteractionSource(ContainerVisual container, InteractionTracker 	tracker)
{
  // Setup the Interaction Source
  _interactionSource = VisualInteractionSource.Create(container);
  // Define the Source Modes for X, Y, and Scale.
  _interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
  _interactionSource.PositionYSourceMode = InteractionSourceMode.EnabledWithoutInertia;
  _interactionSource.ScaleSourceMode = InteractionSourceMode.Disabled;
  // Attach the VisualInteractionSource to InteractionTracker
  tracker.InteractionSources.Add(_interactionSource);
}

Applies to