InteractionSourceMode 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 VisualInteractionSource 如何處理互動的各種定義。 列舉可用的選項為 Disabled 、 EnabledWithInertia 和 EnabledWithoutInertia 。 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
- 屬性
欄位
名稱 | 值 | Description |
---|---|---|
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);
}