ManipulationStartingEventArgs.Pivot Eigenschap

Definitie

Hiermee haalt u een object op of stelt u een object in dat de draai voor een bewerking met één punt beschrijft.

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

Waarde van eigenschap

Een object dat de draai voor een bewerking met één punt beschrijft.

Voorbeelden

In het volgende voorbeeld ziet u een gebeurtenis-handler voor de ManipulationStarting gebeurtenis en stelt u de ManipulationStartingEventArgs.Pivot eigenschap in. Volg de stappen in Walkthrough om dit voorbeeld te testen: Uw First Touch-toepassing maken en de code in stap 4 vervangen door deze code.

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

Opmerkingen

Wanneer u de Pivot eigenschap instelt, bevat de manipulatie rotatiegegevens wanneer de gebruiker één vinger gebruikt tijdens een manipulatie. Dit is om praktijksituaties te simuleren waarin u met één vinger een object kunt draaien, zoals een stuk papier op een tabel. Als dit het Pivot is null, moet de gebruiker twee vingers gebruiken om rotatie te veroorzaken.

Zie het invoeroverzicht voor meer informatie over manipulaties. Zie Walkthrough: Your First Touch Application maken voor een voorbeeld van een toepassing die reageert op manipulaties.

Van toepassing op