Wpf 触摸缩放与投掷效果?

Wpf 触摸缩放与投掷效果?,wpf,touch,Wpf,Touch,在WPF中实现触摸功能相对容易。设置IsManipulationEnabled=“True”并处理ManipulationDelta以应用转换。对于翻译,WPF似乎支持抛投。如果处理操纵或启动,则可以设置所需的速度 现在,在X/Y方向上投掷是不错的,但我想在缩放时也投掷(Z方向)。WPF是否支持此功能 例如,在屏幕上弹手指会变焦,直到膨胀速度达到零。现在,当我的手指离开屏幕时,它会立即停止 这不起作用: private void OnManipulationInertiaStarting(obj

WPF
中实现触摸功能相对容易。设置
IsManipulationEnabled=“True”
并处理
ManipulationDelta
以应用转换。对于翻译,
WPF
似乎支持抛投。如果处理
操纵或启动
,则可以设置所需的速度

现在,在X/Y方向上投掷是不错的,但我想在缩放时也投掷(Z方向)。
WPF
是否支持此功能

例如,在屏幕上弹手指会变焦,直到膨胀速度达到零。现在,当我的手指离开屏幕时,它会立即停止

这不起作用

private void OnManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
{
    // ...
    //
    // Decrease the velocity of the Rectangle's resizing by 
    // 0.1 inches per second every second.
    // (0.1 inches * 96 DIPS per inch / (1000ms^2)
    e.ExpansionBehavior = new InertiaExpansionBehavior()
    {
        InitialVelocity = e.InitialVelocities.ExpansionVelocity,
        DesiredDeceleration = 0.1 * 96 / 1000.0 * 1000.0
    };

    e.Handled = true;
}

莱斯特·洛博。虽然,看看您的代码,您可能已经看到了这篇文章。

谢谢,但该示例显示了相同的问题(因此,这实际上是一个很好的开始)。当您不再触摸屏幕时,缩放立即停止,