尝试这个,
<Image Height="100" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Name="img1" Margin="0,0,0,0" Stretch="Uniform" Source="/1.png">
<Image.RenderTransform>
<CompositeTransform x:Name="img1gesture"/>
</Image.RenderTransform>
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener DragDelta="GestureListener_DragDelta_1"/>
</toolkit:GestureService.GestureListener>
</Image>
<Image Height="100" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Name="img2" Margin="0,0,0,0" Stretch="Uniform" Source="/1.png">
<Image.RenderTransform>
<CompositeTransform x:Name="img2gesture"/>
</Image.RenderTransform>
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener DragDelta="GestureListener_DragDelta_1"/>
</toolkit:GestureService.GestureListener>
</Image>
在 C# 中,
private void GestureListener_DragDelta_1(object sender, Microsoft.Phone.Controls.DragDeltaGestureEventArgs e)
{
img1gesture.TranslateX += e.HorizontalChange;
img2gesture.TranslateX += e.HorizontalChange;
img1gesture.TranslateY += e.VerticalChange;
img2gesture.TranslateY += e.VerticalChange;
}