UIElement.ManipulationStarting UIElement.ManipulationStarting UIElement.ManipulationStarting UIElement.ManipulationStarting Event

定義

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

public:
 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

備註

ManipulationStarting具有的項目上發生事件時IsManipulationEnabled屬性設定為true當使用者將手指放在其上。The ManipulationStarting event occurs on an element that has the IsManipulationEnabled property set to true when the user puts a finger on it. 根據預設,後續的操作事件會報告的位置相對於擁有的項目操作IsManipulationEnabled設定為trueBy 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.

適用於