次の方法で共有


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 プロパティを設定します。 この例をテストするには、「 チュートリアル: First Touch アプリケーションの作成 」の手順に従い、手順 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 プロパティを設定すると、ユーザーが操作中に 1 本の指を使用すると、操作に回転データが含まれます。 これは、1 本の指を使ってオブジェクト (テーブル上の紙など) を回転できる実際の状況をシミュレートするためです。 Pivotnull場合、ユーザーは 2 本の指を使用して回転させる必要があります。

操作の詳細については、「 入力の概要」を参照してください。 操作に応答するアプリケーションの例については、「 チュートリアル: 初めてのタッチ アプリケーションの作成」を参照してください。

適用対象