title: WP7 pinch and zoom image in DataTemplate
body: <p>I've looked at <a href="https://stackoverflow.com/questions/4678268/how-to-zoom-in-and-zoom-out-images-in-wp7">this</a> example of ping/zoom of images and seems pretty straight forward.</p>
  <p>The problem I'm having is that my image is part of the data template of my pivot control and I am unable to access the transform object.</p>
  <pre><code>&lt;DataTemplate&gt;
      &lt;Image Name=&quot;displayImage&quot; VerticalAlignment=&quot;Stretch&quot; HorizontalAlignment=&quot;Stretch&quot; Source=&quot;{Binding photo_link}&quot; RenderTransformOrigin=&quot;0.5, 0.5&quot; CacheMode=&quot;BitmapCache&quot;&gt;
          &lt;Image.RenderTransform&gt;
              &lt;CompositeTransform x:Name=&quot;transform&quot; /&gt;
          &lt;/Image.RenderTransform&gt;
          &lt;toolkit:GestureService.GestureListener&gt;
              &lt;toolkit:GestureListener PinchDelta=&quot;OnPinchDelta&quot; PinchStarted=&quot;OnPinchStarted&quot; /&gt;
          &lt;/toolkit:GestureService.GestureListener&gt;
      &lt;/Image&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  <p>In this method, <code>transform</code> cannot be resolved.</p>
  <pre><code>private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
  {
      initialAngle =  transform.Rotation;
      initialScale = transform.ScaleX;
  }
  </code></pre>
  <p>any ideas??</p>
  <p>thanks!</p>