InertiaTranslationBehavior 類別

定義

控制平移操作在慣性期間的減速。

public ref class InertiaTranslationBehavior
public class InertiaTranslationBehavior
type InertiaTranslationBehavior = class
Public Class InertiaTranslationBehavior
繼承
InertiaTranslationBehavior

範例

下列範例顯示事件處理程式, 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

備註

類別 InertiaTranslationBehavior 會指定翻譯操作在慣性時的行為。 使用 TranslationBehavior 事件中的 ManipulationInertiaStarting 屬性來執行下列動作:

DesiredDisplacement設定 或DesiredDeceleration,但不能同時設定兩者。 當您設定其中一個屬性時,如果有值,另一個屬性就會變更為 Double.NaN

如需操作的詳細資訊,請參閱 輸入概觀。 如需回應操作的應用程式範例,請參閱逐步解說 :建立您的第一個觸控應用程式

建構函式

InertiaTranslationBehavior()

初始化 InertiaTranslationBehavior 類別的新執行個體。

屬性

DesiredDeceleration

取得或設定線性移動在裝置獨立單位中變慢的速率, (每單位 1/96 英吋,每平方毫秒) 。

DesiredDisplacement

取得或設定操作在慣性結束時的直線移動。

InitialVelocity

取得或設定直線移動在慣性階段開始時的初始速率。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於