Share via


InteractionSourceMode 枚举

定义

提供 VisualInteractionSource 如何处理交互的各种定义。 可用于枚举的选项为 DisabledEnabledWithInertiaEnabledWithoutInertia 。 InteractionSourceMode 可用于定义 VisualInteractionSource 的 X 轴、Y 轴和刻度轴的行为。

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
继承
InteractionSourceMode
属性

字段

Disabled 0

已禁用交互。

EnabledWithInertia 1

使用惯性启用交互。

EnabledWithoutInertia 2

在没有惯性的情况下启用交互。

示例

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

适用于