UIElement.ManipulationInertiaStarting UIElement.ManipulationInertiaStarting UIElement.ManipulationInertiaStarting UIElement.ManipulationInertiaStarting Event

定義

當輸入裝置在操作期間失去和 UIElement 物件的通訊以及慣性開始時發生。Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins.

public:
 event EventHandler<System::Windows::Input::ManipulationInertiaStartingEventArgs ^> ^ ManipulationInertiaStarting;
public event EventHandler<System.Windows.Input.ManipulationInertiaStartingEventArgs> ManipulationInertiaStarting;
member this.ManipulationInertiaStarting : EventHandler<System.Windows.Input.ManipulationInertiaStartingEventArgs> 
Public Custom Event ManipulationInertiaStarting As EventHandler(Of ManipulationInertiaStartingEventArgs) 

範例

下列範例所示ManipulationInertiaStarting事件處理常式,並設定為平移、 擴充和旋轉在慣性期間所需的減速程度。The following example shows the ManipulationInertiaStarting event handler and sets the desired deceleration for translation, expansion, and rotation that is used during inertia. 這個範例是在較大範例的一部分逐步解說:建立您的第一個觸控應用程式This example is part of a larger example in Walkthrough: Creating Your First Touch Application.

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

備註

ManipulationInertiaStarting使用者拿起所有從畫面的指於操作期間,就會發生事件。The ManipulationInertiaStarting event occurs when the user lifts all of the fingers from the screen during a manipulation. 例如,如果使用者 「 擲回 」UIElement介面,使用者會觸及UIElement若要開始的動作,將手指移過螢幕的一小段距離,並再放開UIElementFor example, if a user "throws" a UIElement across a surface, the user will touch the UIElement to begin the action, move the finger across the screen for a short distance, and then release the UIElement. 當使用者放開項目時,會開始慣性和ManipulationInertiaStarting就會發生事件。When the user releases the element, inertia begins and the ManipulationInertiaStarting event occurs. UIElement會繼續接收ManipulationDelta表示慣性的項目上發生的事件。The UIElement continues to receive ManipulationDelta events to indicate that inertia is occurring on the element.

若要指定慣性的行為,您可以使用此事件。You can use this event to specify the behavior of the inertia. 例如,您可以設定慣性開始時使用的初始速度。For example, you can set the initial velocity that is used when inertia begins. 藉由設定所需的減速程度,或藉由設定所需的位置,您也可以指定慣性的數量。You can also specify the amount of inertia by setting the desired deceleration or by setting the desired placement. 您可以分別設定這些值,每種類型的操作 (平移、 擴充或旋轉)。You can set these values for each type of manipulation (translation, expansion, or rotation) independently. 如需詳細資訊,請參閱ManipulationInertiaStartingEventArgsFor more information, see ManipulationInertiaStartingEventArgs.

如需有關操作的詳細資訊,請參閱輸入概觀For more information about manipulations, see the Input Overview. 如需回應操作的應用程式的範例,請參閱逐步解說:建立您的第一個觸控應用程式For an example of an application that responds to manipulations, see Walkthrough: Creating Your First Touch Application.

路由事件資訊Routed Event Information

識別項欄位Identifier field ManipulationInertiaStartingEvent
路由策略Routing strategy 事件反昇Bubbling
Delegate - 委派Delegate 型別 EventHandler<TEventArgs>ManipulationInertiaStartingEventArgsEventHandler<TEventArgs> of type ManipulationInertiaStartingEventArgs.

適用於