通过


InertiaExpansionBehavior 类

定义

控制惯性期间调整操作大小的减速。

public ref class InertiaExpansionBehavior
public class InertiaExpansionBehavior
type InertiaExpansionBehavior = class
Public Class InertiaExpansionBehavior
继承
InertiaExpansionBehavior

示例

下面的示例演示 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

注解

InertiaExpansionBehavior 类指定扩展操作在惯性时的行为方式。 使用 ExpansionBehavior 事件中的 ManipulationInertiaStarting 属性执行以下操作:

设置或DesiredExpansionDesiredDeceleration设置,但不能同时设置两者。 设置其中一个属性时,如果属性具有值,则另一个属性将更改为 Double.NaN

有关操作的详细信息,请参阅 输入概述。 有关响应操作的应用程序的示例,请参阅 演练:创建第一个 Touch 应用程序

构造函数

名称 说明
InertiaExpansionBehavior()

初始化 InertiaExpansionBehavior 类的新实例。

属性

名称 说明
DesiredDeceleration

获取或设置以设备无关单位(每单位 1/96 英寸)/平方毫秒大小变慢的速率。

DesiredExpansion

获取或设置元素在惯性结束时调整大小的量。

InitialRadius

获取或设置初始平均半径。

InitialVelocity

获取或设置元素在惯性开始时调整大小的初始速率。

方法

名称 说明
Equals(Object)

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

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

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

(继承自 Object)

适用于