InertiaRotationBehavior 類別

定義

控制旋轉操作在慣性期間的減速。

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

範例

下列範例顯示 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

備註

類別 InertiaRotationBehavior 會指定旋轉操作在慣性時的行為。 RotationBehavior使用 事件中的 ManipulationInertiaStarting 屬性來執行下列動作:

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

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

建構函式

InertiaRotationBehavior()

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

屬性

DesiredDeceleration

取得或設定旋轉變慢的速率 (以每平方毫秒的度數為單位)。

DesiredRotation

取得或設定慣性移動結束時的旋轉 (以度數為單位)。

InitialVelocity

取得或設定旋轉在慣性階段開始時的初始速率。

方法

Equals(Object)

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

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於