Windows Phone 7 development

Posts tagged ‘App Store’

Simple center zoom

To add simple pinch zoom (that I used in my Spirit Level) use the Silverlight Toolkit for WP7 and add the pinch GetureListener to a grid

  <toolkit:GestureListener PinchDelta="GestureListener_PinchDelta" />

and code in event

 private void GestureListener_PinchDelta(object sender, PinchGestureEventArgs e)
    if (e.DistanceRatio < 1.0 || e.DistanceRatio > 1.4)
 // Create the animation for pinch
   Storyboard storyboard = new Storyboard();
   DoubleAnimation pinchXAnimation = new DoubleAnimation();
   pinchXAnimation.To = e.DistanceRatio;
   pinchXAnimation.Duration = TimeSpan.FromSeconds(0.3);
   Storyboard.SetTargetProperty(pinchXAnimation, new PropertyPath("GridScaling.ScaleX"));
   Storyboard.SetTarget(pinchXAnimation, GridScaling);

   DoubleAnimation pinchYAnimation = new DoubleAnimation();
   pinchYAnimation.To = e.DistanceRatio;
   pinchYAnimation.Duration = TimeSpan.FromSeconds(0.3);
   Storyboard.SetTargetProperty(pinchYAnimation, new PropertyPath("GridScaling.ScaleY"));
   Storyboard.SetTarget(pinchYAnimation, GridScaling);



New versions of Apps

Spirit Level

Classic Metronome

Tip Calc


%d bloggers like this: