ManipulationStartingEventArgs.Pivot 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置描述单点操作透视的对象。
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 属性。 若要测试此示例,请按照 演练:创建第一个触控应用程序 的步骤操作,并将步骤 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 时,当用户在操作过程中使用一根手指时,操作将包含旋转数据。 这是为了模拟现实世界的情况,你可以在其中使用一根手指来旋转对象,例如表格上的一张纸。
Pivot
null如果是,用户必须使用两根手指来引起旋转。
有关操作的详细信息,请参阅 输入概述。 有关响应操作的应用程序的示例,请参阅 演练:创建第一个 Touch 应用程序。