语言

ManipulationInertiaStartingEventArgs 类

定义

提供事件的数据 ManipulationInertiaStarting 。

public ref class ManipulationInertiaStartingEventArgs sealed : System::Windows::Input::InputEventArgs
public sealed class ManipulationInertiaStartingEventArgs : System.Windows.Input.InputEventArgs
type ManipulationInertiaStartingEventArgs = class
    inherit InputEventArgs
Public NotInheritable Class ManipulationInertiaStartingEventArgs
Inherits InputEventArgs
继承
ManipulationInertiaStartingEventArgs

示例

下面的示例演示 ManipulationInertiaStarting 事件处理程序,并设置在惯性期间使用的转换、扩展和旋转所需的减速。 本示例是 演练:创建第一个触控应用程序的大型示例的一部分。

void Window_InertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
{

    // Decrease the velocity of the Rectangle's movement by 
    // 10 inches per second every second.
    // (10 inches * 96 pixels per inch / 1000ms^2)
    e.TranslationBehavior.DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0);

    // Decrease the velocity of the Rectangle's resizing by 
    // 0.1 inches per second every second.
    // (0.1 inches * 96 pixels per inch / (1000ms^2)
    e.ExpansionBehavior.DesiredDeceleration = 0.1 * 96 / (1000.0 * 1000.0);

    // Decrease the velocity of the Rectangle's rotation rate by 
    // 2 rotations per second every second.
    // (2 * 360 degrees / (1000ms^2)
    e.RotationBehavior.DesiredDeceleration = 720 / (1000.0 * 1000.0);

    e.Handled = true;
}
Private Sub Window_InertiaStarting(ByVal sender As Object,
                                   ByVal e As ManipulationInertiaStartingEventArgs)

    ' Decrease the velocity of the Rectangle's movement by 
    ' 10 inches per second every second.
    ' (10 inches * 96 pixels per inch / 1000ms^2)
    e.TranslationBehavior.DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0)

    ' Decrease the velocity of the Rectangle's resizing by 
    ' 0.1 inches per second every second.
    ' (0.1 inches * 96 pixels per inch / (1000ms^2)
    e.ExpansionBehavior.DesiredDeceleration = 0.1 * 96 / (1000.0 * 1000.0)

    ' Decrease the velocity of the Rectangle's rotation rate by 
    ' 2 rotations per second every second.
    ' (2 * 360 degrees / (1000ms^2)
    e.RotationBehavior.DesiredDeceleration = 720 / (1000.0 * 1000.0)

    e.Handled = True
End Sub

注解

可以使用对象 ManipulationInertiaStartingEventArgs 来指定操作的惯性行为。 可以使用和属性单独TranslationBehaviorExpansionBehaviorRotationBehavior为每种操作类型指定惯性行为。 每个属性都是表示惯性行为的对象类型,并且在每个情况下,可以指定以下内容:

  • 惯性开始时的初始速度。

  • 惯性结束时操作的所需位置。

  • 惯性所需的减速。

通常在惯性结束或惯性所需减速时指定操作的所需位置,但不能同时指定两者。

有关操作的详细信息,请参阅 输入概述。

属性

名称 说明
Device

获取启动此事件的输入设备。

(继承自 InputEventArgs)
ExpansionBehavior

获取或设置扩张惯性运动放缓的速度。

Handled

获取或设置一个值,该值指示路由事件在传输路由时的事件处理的当前状态。

(继承自 RoutedEventArgs)
InitialVelocities

获取惯性开始前发生的操作更改的速率。

ManipulationContainer

获取属性 ManipulationOrigin 相对于的容器。

ManipulationOrigin

获取或设置操作源自的点。

Manipulators

获取表示操作的触摸联系人的对象集合。

OriginalSource

获取由纯命中测试确定的原始报告源,然后再由父类进行任何可能的 Source 调整。

(继承自 RoutedEventArgs)
RotationBehavior

获取或设置旋转惯性移动速度变慢的速度。

RoutedEvent

获取或设置 RoutedEvent 与此 RoutedEventArgs 实例关联的项。

(继承自 RoutedEventArgs)
Source

获取或设置对引发事件的对象的引用。

(继承自 RoutedEventArgs)
Timestamp

获取发生此事件的时间。

(继承自 InputEventArgs)
TranslationBehavior

获取或设置线性惯性移动速度变慢的速度。

方法

名称 说明
Cancel()

取消操作。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type。

(继承自 Object)
InvokeEventHandler(Delegate, Object)

以特定于类型的方式调用事件处理程序,从而提高事件系统效率。

(继承自 InputEventArgs)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
OnSetSource(Object)

在派生类中重写时,每当实例属性的值 Source 发生更改时,都提供通知回调入口点。

(继承自 RoutedEventArgs)
SetInertiaParameter(InertiaParameters2D)

指定惯性期间操作的行为。

ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于