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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章