英語で読む

次の方法で共有


UIElement.ManipulationInertiaStarting イベント

定義

入力デバイスが操作中に UIElement オブジェクトとの接続を失い、慣性による処理が開始されると発生します。

C#
public event EventHandler<System.Windows.Input.ManipulationInertiaStartingEventArgs> ManipulationInertiaStarting;

イベントの種類

次の例では、イベント ハンドラーを ManipulationInertiaStarting 示し、慣性時に使用される平行移動、展開、回転に必要な減速を設定します。 この例は、「 チュートリアル: 初めてのタッチ アプリケーションの作成」の大きな例の一部です。

C#
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;
}

注釈

このイベントは ManipulationInertiaStarting 、操作中にユーザーが画面からすべての指を離したときに発生します。 たとえば、ユーザーがサーフェス全体で を UIElement "スロー" した場合、ユーザーは をタッチ UIElement してアクションを開始し、画面全体で指を少し離してから を UIElement離します。 ユーザーが要素を解放すると、慣性が開始され、イベントが ManipulationInertiaStarting 発生します。 は UIElement 、慣性が 要素で発生していることを示すイベントを受信し続けます ManipulationDelta

このイベントを使用して、慣性の動作を指定できます。 たとえば、慣性の開始時に使用される初期速度を設定できます。 また、必要な減速を設定するか、目的の配置を設定して慣性量を指定することもできます。 これらの値は、操作の種類 (平行移動、展開、または回転) ごとに個別に設定できます。 詳細については、「ManipulationInertiaStartingEventArgs」を参照してください。

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

ルーティングされたイベント情報

識別子フィールド ManipulationInertiaStartingEvent
ルーティング戦略 バブル
代理人 EventHandler<TEventArgs> 型の ManipulationInertiaStartingEventArgs

適用対象

製品 バージョン
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9