Below is a simplified example based on ColinE's answer.
Consider an ellipse canvas:
<Canvas Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Ellipse Fill="Red" Canvas.Left="100" Canvas.Top="100" Width="100" Height="100" ManipulationMode="All" ManipulationDelta="Ellipse_ManipulationDelta_1"/> </Canvas>
Now in the code behind you are handling ManipulationDelta:
private void Ellipse_ManipulationDelta_1(object sender, ManipulationDeltaRoutedEventArgs e) { Ellipse myEllipse = (Ellipse)sender; Canvas.SetLeft(myEllipse, Canvas.GetLeft(myEllipse) + e.Delta.Translation.X); Canvas.SetTop(myEllipse, Canvas.GetTop(myEllipse) + e.Delta.Translation.Y); }
source share