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 使用して、次の操作を行います。

  • プロパティを設定して開始するときの慣性の初期速度を InitialVelocity 指定します。

  • プロパティを設定して慣性が終了したときの操作の目的の位置を DesiredDisplacement 指定します。

  • プロパティを設定して、慣性の必要な減速を DesiredDeceleration 指定します。

または を DesiredDisplacement 設定しますが、 DesiredDeceleration両方は設定しません。 これらのプロパティの 1 つを設定すると、値がある場合、もう一方のプロパティは に Double.NaN 変更されます。

操作の詳細については、「 入力の概要」を参照してください。 操作に応答するアプリケーションの例については、「 チュートリアル: 初めてのタッチ アプリケーションの作成」を参照してください。

コンストラクター

InertiaTranslationBehavior()

InertiaTranslationBehavior クラスの新しいインスタンスを初期化します。

プロパティ

DesiredDeceleration

ミリ秒単位のデバイスに依存しない単位 (単位あたり 1/96 インチ) で線形移動が遅くなる速度を取得または設定します。

DesiredDisplacement

慣性が終わるときの操作の直線運動を取得または設定します。

InitialVelocity

慣性フェーズが開始するときの操作の直線的な動きの初期速度を取得または設定します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象