Windows Phone 触摸拖动

<Grid x:Name="LayoutRoot" Background="Transparent">
        <Rectangle Fill="Blue" VerticalAlignment="Top" HorizontalAlignment="Center" Height="100" Width="100" ManipulationDelta="Rectangle_ManipulationDelta" Margin="22,10,0,0">
            <Rectangle.RenderTransform>
                <TranslateTransform x:Name="a"/>
            </Rectangle.RenderTransform>
        </Rectangle>
    </Grid>
private void Rectangle_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
        {
            this.a.X += e.DeltaManipulation.Translation.X;
            this.a.Y += e.DeltaManipulation.Translation.Y;

        }


发布了62 篇原创文章 · 获赞 0 · 访问量 2万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章