UIElement.IsManipulationEnabled Vlastnost

Definice

Získá nebo nastaví hodnotu, která označuje, zda jsou povoleny události manipulace v tomto UIElementobjektu .

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

Hodnota vlastnosti

true pokud jsou v tomto UIElementpřípadě povoleny události manipulace, falsev opačném případě . Výchozí formát je false.

Příklady

Následující příklad vytvoří aplikaci, která má červený obdélník. Vlastnost IsManipulationEnabled Rectangle je nastavená na hodnotu true a okno aplikace se přihlásí k odběru ManipulationStartingudálostí , ManipulationDeltaa ManipulationInertiaStarting . Tento příklad je součástí rozsáhlejšího příkladu v návodu: Vytvoření aplikace prvního dotyku.

<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>

Poznámky

Pokud chceteUIElement, aby objekty přijímaly ManipulationStartingudálosti , , ManipulationDelta, ManipulationInertiaStarting, ManipulationBoundaryFeedbacka, ManipulationStartednastavte ManipulationCompleted tuto vlastnost na hodnotu true. Další informace o manipulaci najdete v přehledu vstupu. Příklad aplikace, která reaguje na manipulaci, najdete v tématu Návod: Vytvoření aplikace prvního dotyku.

Platí pro