ManipulationStartingEventArgs.Pivot Egenskap

Definition

Hämtar eller anger ett objekt som beskriver pivoten för en enpunktsmanipulering.

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

Egenskapsvärde

Ett objekt som beskriver pivoten för en enpunktsmanipulering.

Exempel

I följande exempel visas en händelsehanterare för ManipulationStarting händelsen och egenskapen anges ManipulationStartingEventArgs.Pivot . Om du vill testa det här exemplet följer du stegen i Genomgång: Skapa ditt First Touch-program och ersätt koden i steg 4 med den här koden.

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

Kommentarer

När du anger Pivot egenskapen innehåller manipulationen rotationsdata när användaren använder ett finger under en manipulering. Detta är för att simulera verkliga situationer där du kan använda ett finger för att rotera ett objekt, till exempel ett papper på en tabell. Pivot Om är nullmåste användaren använda två fingrar för att orsaka rotation.

Mer information om manipuleringar finns i Översikt över indata. Ett exempel på ett program som svarar på manipulationer finns i Genomgång: Skapa ditt First Touch-program.

Gäller för