UIElement.IsManipulationEnabled 属性   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示是否对此 UIElement 启用操作事件。
public:
 property bool IsManipulationEnabled { bool get(); void set(bool value); };
	public bool IsManipulationEnabled { get; set; }
	member this.IsManipulationEnabled : bool with get, set
	Public Property IsManipulationEnabled As Boolean
	属性值
如果对此 UIElement 启用操作事件,则为 true;否则为 false。 默认值为 false。
示例
以下示例创建一个具有红色 Rectangle 的应用程序。 IsManipulationEnabled Rectangle 的 属性设置为 true,并且应用程序的窗口订阅 ManipulationStarting、 ManipulationDelta和 ManipulationInertiaStarting 事件。 此示例是 演练:创建第一个触摸应用程序中更大示例的一部分。
<Window x:Class="BasicManipulation.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Move, Size, and Rotate the Square"
        WindowState="Maximized"
        ManipulationStarting="Window_ManipulationStarting"
        ManipulationDelta="Window_ManipulationDelta"
        ManipulationInertiaStarting="Window_InertiaStarting">
  <Window.Resources>
    <!--The movement, rotation, and size of the Rectangle is 
        specified by its RenderTransform.-->
    <MatrixTransform x:Key="InitialMatrixTransform">
      <MatrixTransform.Matrix>
        <Matrix OffsetX="200" OffsetY="200"/>
      </MatrixTransform.Matrix>
    </MatrixTransform>
  </Window.Resources>
  <Canvas>
    <Rectangle Fill="Red" Name="manRect"
                 Width="200" Height="200" 
                 RenderTransform="{StaticResource InitialMatrixTransform}"
                 IsManipulationEnabled="true" />
  </Canvas>
</Window>
	注解
如果希望 UIElement 接收 、、、ManipulationInertiaStartingManipulationDeltaManipulationStartedManipulationBoundaryFeedback、 和 ManipulationCompleted 事件,请将此属性设置为 true。ManipulationStarting 有关操作的详细信息,请参阅 输入概述。 有关响应操作的应用程序的示例,请参阅 演练:创建第一个触摸应用程序。