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 屬性時,當使用者在操作期間使用一指時,操作會包含旋轉數據。 這是模擬真實世界的情況,您可以在其中使用一指來旋轉物件,例如表格上的紙張片段。 Pivot如果 為null,則用戶必須使用兩指來造成旋轉。

如需操作的詳細資訊,請參閱 輸入概觀。 如需回應操作的應用程式範例,請參閱 逐步解說:建立您的第一個觸控應用程式

適用於