UIElement.IsManipulationEnabled Vlastnost
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Získá nebo nastaví hodnotu, která indikuje, zda jsou u této UIElementudálosti povoleny události manipulace .
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 jsou-li u této UIElementakce povoleny události manipulace ; jinak , false. Výchozí hodnota je false.
Příklady
Následující příklad vytvoří aplikaci, která má červený obdélník. Vlastnost IsManipulationEnabled Rectangle je nastavena na hodnotu true a okno aplikace se přihlásí k odběru ManipulationStarting, ManipulationDeltaa ManipulationInertiaStarting události. Tento příklad je součástí většího příkladu v návodu: Vytvoření první dotykové aplikace.
<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
Tuto vlastnost nastavte na true, pokud chcete UIElement přijmout ManipulationStarting, ManipulationStarted, ManipulationDelta, , ManipulationInertiaStarting, ManipulationBoundaryFeedbacka ManipulationCompleted události. Další informace o manipulaci najdete v přehledu vstupu. Příklad aplikace, která reaguje na manipulaci, najdete v části Návod: Vytvoření první dotykové aplikace.