ManipulationInertiaStartingEventArgs 类

定义

ManipulationInertiaStarting 事件提供数据。Provides data for the ManipulationInertiaStarting event.

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了事件处理程序, 并为惯性期间使用的转换、扩展和旋转设置了所需的减速度。The following example shows the ManipulationInertiaStarting event handler and sets the desired deceleration for translation, expansion, and rotation that is used during inertia. 本示例是演练中更大示例的一部分:正在创建您的第一个 Touch 应用程序。This example is part of a larger example in Walkthrough: Creating Your First Touch Application.

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对象指定操作的惯性行为。You can use the ManipulationInertiaStartingEventArgs object to specify the inertial behavior of a manipulation. 您可以使用TranslationBehaviorExpansionBehaviorRotationBehavior属性分别指定每种操作的惯性行为。You can specify the inertial behavior for each type of manipulation separately by using the TranslationBehavior, ExpansionBehavior, and RotationBehavior properties. 每个属性都是表示惯性行为的对象类型, 在每种情况下, 你可以指定以下内容:Each property is a type of object that represents the inertial behavior and in each case, you can specify the following:

  • 惯性开始时的初始速度。The initial velocity of the inertia when it begins.

  • 惯性结束时操作所需的位置。The desired position of the manipulation when inertia ends.

  • 惯性所需的减速度。The desired deceleration of the inertia.

通常, 可以在惯性结束时指定所需的操作位置, 也可以指定惯性的所需减速度, 但不能同时指定这两者。You typically specify either the desired position of the manipulation when inertia ends or the desired deceleration of the inertia, but not both.

有关操作的详细信息, 请参阅输入概述For more information about manipulations, see the Input Overview.

属性

Device

获取启动此事件的输入设备。Gets the input device that initiated this event.

(继承自 InputEventArgs)
ExpansionBehavior

获取或设置延伸惯性运动减慢的速率。Get or sets the rate of slowdown of expansion inertial movement.

Handled

获取或设置一个值,该值指示针对路由事件(在其经过路由时)的事件处理的当前状态。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

(继承自 RoutedEventArgs)
InitialVelocities

获取惯性开始发生之前发生的操作的变化速率。Gets the rates of changes to the manipulation that occur before inertia starts.

ManipulationContainer

获取 ManipulationOrigin 属性所相对的容器。Gets the container that the ManipulationOrigin property is relative to.

ManipulationOrigin

获取或设置操作的起源点。Gets or sets the point from which the manipulation originated.

Manipulators

获取表示操作的触摸触点的对象集合。Gets a collection of objects that represents the touch contacts for the manipulation.

OriginalSource

在父类进行任何可能的 Source 调整之前,获取由纯命中测试确定的原始报告源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

(继承自 RoutedEventArgs)
RotationBehavior

获取或设置旋转惯性运动减慢的速率。Gets or sets the rate of slowdown of rotational inertial movement.

RoutedEvent

获取或设置与此 RoutedEventArgs 实例关联的 RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance.

(继承自 RoutedEventArgs)
Source

获取或设置对引发事件的对象的引用。Gets or sets a reference to the object that raised the event.

(继承自 RoutedEventArgs)
Timestamp

获取此事件发生时的时间。Gets the time when this event occurred.

(继承自 InputEventArgs)
TranslationBehavior

获取或设置线性惯性运动减慢的速率。Gets or sets the rate of slowdown of linear inertial movement.

方法

Cancel()

取消操作。Cancels the manipulation.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

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

以特定于类型的方式调用事件处理程序,这样做可以提高事件系统效率。Invokes event handlers in a type-specific way, which can increase event system efficiency.

(继承自 InputEventArgs)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnSetSource(Object)

在派生类中重写时,每当实例的 Source 属性的值发生更改,则提供一个通知回调入口点。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.

(继承自 RoutedEventArgs)
SetInertiaParameter(InertiaParameters2D)

指定惯性发生期间的操作行为。Specifies the behavior of a manipulation during inertia.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于