UIElement.ManipulationStarting 事件

定義

發生於第一次建立操作處理器時。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) 

事件類型

EventHandler<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 當使用者將手指放在屬性設為的專案上時,就會發生此事件 trueThe 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. 您可以藉由設定屬性,指定位置應該相對於另一個元素 ManipulationContainerYou 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.

您也可以在的事件處理常式中執行下列作業 ManipulationStartingYou 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 型別 EventHandler<TEventArgs>ManipulationStartingEventArgsEventHandler<TEventArgs> of type ManipulationStartingEventArgs.

適用於