UIElement.IsManipulationEnabled Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define um valor que indica se eventos de manipulação estão ativados neste 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
Valor de Propriedade
true se os eventos de manipulação forem ativados neste UIElement; caso contrário, false. A predefinição é false.
Exemplos
O exemplo seguinte cria uma aplicação que tem um Retângulo vermelho. A IsManipulationEnabled propriedade do Retângulo é definida como verdadeira e a janela da aplicação subscreve os ManipulationStartingeventos , ManipulationDelta, e ManipulationInertiaStarting . Este exemplo faz parte de um exemplo mais amplo em Walkthrough: Criar a Sua Aplicação de Primeiro Toque.
<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>
Observações
Defina esta propriedade como verdadeira se quiser que recebam UIElement os ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting, ManipulationBoundaryFeedback, e ManipulationCompleted eventos. Para mais informações sobre manipulações, consulte a Visão Geral de Entrada. Para um exemplo de uma aplicação que responde a manipulações, veja Guia: Criar a Sua Aplicação de Primeiro Toque.