UIElement.ManipulationStarting Event


發生於第一次建立操作處理器時。Occurs when the manipulation processor is first created.

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


下列範例會顯示 ManipulationStarting 事件的事件處理常式,並將 ManipulationContainer 設定為接收操作事件的父元素,讓操作的座標相對於父元素。The following example shows the event handler for the ManipulationStarting event and sets the ManipulationContainer to the parent element that receives the manipulation events so that the coordinates of the manipulation are relative to the parent element. 這個範例是逐步解說:建立您的第一個觸控應用程式中較大範例的一部分。This example is part of a larger example in Walkthrough: Creating Your First Touch Application.

void Window_ManipulationStarting(object sender, ManipulationStartingEventArgs e)
    e.ManipulationContainer = this;
    e.Handled = true;
Private Sub Window_ManipulationStarting(ByVal sender As Object, ByVal e As ManipulationStartingEventArgs)
    e.ManipulationContainer = Me
    e.Handled = True
End Sub


當使用者在其上放置手指時,IsManipulationEnabled 屬性設定為 true 的專案,就會發生 ManipulationStarting 事件。The ManipulationStarting event occurs on an element that has the IsManipulationEnabled property set to true when the user puts a finger on it. 根據預設,後續的操作事件會報告操作的位置(相對於 IsManipulationEnabled 設定為 true的元素)。By default, subsequent manipulation events report the position of the manipulation relative to the element that has IsManipulationEnabled set to true. 您可以藉由設定 ManipulationContainer 屬性,指定位置應該相對於另一個元素。You can specify that the position should be relative to another element by setting the ManipulationContainer property. 例如,您可以讓操作相對於元素的父系。For example, you can make the manipulation relative to the parent of the element.

您也可以在 ManipulationStarting的事件處理常式中執行下列動作:You can also do the following in an event handler for ManipulationStarting:

如需操作的詳細資訊,請參閱輸入總覽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 ManipulationStartingEvent
路由策略Routing strategy 路由Bubbling
Delegate - 委派Delegate 型別 EventHandler<TEventArgs>ManipulationStartingEventArgsEventHandler<TEventArgs> of type ManipulationStartingEventArgs.

Applies to