UIElement.IsManipulationEnabled プロパティ

定義

この 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 です。

次の例では、赤い四角形を持つアプリケーションを作成します。 IsManipulationEnabled Rectangle の プロパティは true に設定され、アプリケーションのウィンドウは 、ManipulationDelta、および ManipulationInertiaStarting イベントをManipulationStartingサブスクライブします。 この例は、「 チュートリアル: 初めてのタッチ アプリケーションの作成」の大きな例の一部です。

<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受信する場合は、このプロパティを ManipulationStartedManipulationStartingManipulationInertiaStartingManipulationDeltaManipulationBoundaryFeedbacktrue に設定します。ManipulationCompleted 操作の詳細については、「 入力の概要」を参照してください。 操作に応答するアプリケーションの例については、「 チュートリアル: 初めてのタッチ アプリケーションの作成」を参照してください。

適用対象