แก้ไข

แชร์ผ่าน


ManipulationPivot Class

Definition

Specifies how a rotation occurs with one point of user input.

public ref class ManipulationPivot
public class ManipulationPivot
type ManipulationPivot = class
Public Class ManipulationPivot
Inheritance
ManipulationPivot

Examples

The following example shows an event handler for the ManipulationStarting event and sets the ManipulationStartingEventArgs.Pivot property. To test this example, follow the steps in Walkthrough: Creating Your First Touch Application and replace the code in step 4 with this 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

Remarks

The ManipulationStartingEventArgs.Pivot property is a ManipulationPivot. When you set Pivot in an event handler for the ManipulationStarting event, the manipulation will contain rotation data when the user uses one finger during a manipulation. This is to simulate real-world situations where you can use one finger to rotate an object, such as a piece of paper on a table. If the Pivot is null, the user must use two fingers to cause rotation.

Constructors

ManipulationPivot()

Initializes a new instance of the ManipulationPivot class.

ManipulationPivot(Point, Double)

Initializes a new instance of the ManipulationPivot class with the specified point of a single-point manipulation.

Properties

Center

Gets or sets the center of a single-point manipulation.

Radius

Gets or sets the area around the pivot that is used to determine how much rotation and translation occurs when a single point of contact initiates the manipulation.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to