共用方式為


ManipulationStartingEventArgs.Pivot 屬性

定義

取得或設定一個描述樞軸的物件,用於單點操作。

public:
 property System::Windows::Input::ManipulationPivot ^ Pivot { System::Windows::Input::ManipulationPivot ^ get(); void set(System::Windows::Input::ManipulationPivot ^ value); };
public System.Windows.Input.ManipulationPivot Pivot { get; set; }
member this.Pivot : System.Windows.Input.ManipulationPivot with get, set
Public Property Pivot As ManipulationPivot

屬性值

描述單點操作樞軸的物件。

範例

以下範例展示了該事件的 ManipulationStarting 事件處理程序並設定屬性 ManipulationStartingEventArgs.Pivot 。 要測試此範例,請依照 「攻略:建立您的首次觸控應用程式 」中的步驟,並將步驟 4 中的程式碼替換為此程式碼。

void Window_ManipulationStarting(object sender, ManipulationStartingEventArgs e)
{
    // Set the ManipulationPivot so that the element rotates as it is
    // moved with one finger.
    FrameworkElement element = e.OriginalSource as FrameworkElement;
    ManipulationPivot pivot = new ManipulationPivot();
    pivot.Center = new Point(element.ActualWidth / 2, element.ActualHeight / 2);
    pivot.Radius = 20;
    e.Pivot = pivot;

    e.ManipulationContainer = this;
    e.Handled = true;
}
Private Sub Window_ManipulationStarting(ByVal sender As Object, ByVal e As ManipulationStartingEventArgs)
    ' Set the ManipulationPivot so that the element rotates as it is
    ' moved with one finger.
    Dim element As FrameworkElement = TryCast(e.OriginalSource, FrameworkElement)
    Dim pivot As New ManipulationPivot()
    pivot.Center = New Point(element.ActualWidth / 2, element.ActualHeight / 2)
    pivot.Radius = 20
    e.Pivot = pivot

    e.ManipulationContainer = Me
    e.Handled = True
End Sub

備註

當你設定這個 Pivot 屬性時,操作會包含使用者在操作過程中用一根手指時的旋轉資料。 這是為了模擬現實情境,例如用一根手指旋轉物體,例如桌上的一張紙。 如果是 Pivotnull,使用者必須用兩根手指來進行旋轉。

欲了解更多操作資訊,請參閱 輸入概述。 關於回應操作的應用程式範例,請參見 「攻略:建立你的首次觸控應用程式」。

適用於