ManipulationPivot 类

定义

指定如何使用一个用户输入点发生旋转。Specifies how a rotation occurs with one point of user input.

public ref class ManipulationPivot
public class ManipulationPivot
type ManipulationPivot = class
Public Class ManipulationPivot
继承
ManipulationPivot

示例

下面的示例演示ManipulationStarting事件的事件处理程序并ManipulationStartingEventArgs.Pivot设置属性。The following example shows an event handler for the ManipulationStarting event and sets the ManipulationStartingEventArgs.Pivot property. 若要测试此示例, 请按照演练:创建第一个 Touch 应用程序, 并将步骤4中的代码替换为此代码。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

注解

ManipulationStartingEventArgs.Pivot 属性ManipulationPivot为。The ManipulationStartingEventArgs.Pivot property is a ManipulationPivot. 在事件的Pivot事件处理程序ManipulationStarting中设置时, 如果用户在操作过程中使用一根手指, 则操作将包含旋转数据。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. Pivot如果为null, 则用户必须使用两根手指来产生旋转。If the Pivot is null, the user must use two fingers to cause rotation.

构造函数

ManipulationPivot()

初始化 ManipulationPivot 类的新实例。Initializes a new instance of the ManipulationPivot class.

ManipulationPivot(Point, Double)

用单点操作的指定点初始化 ManipulationPivot 类的新实例。Initializes a new instance of the ManipulationPivot class with the specified point of a single-point manipulation.

属性

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.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于