I looked at this ping / zoom example and it seems pretty straight forward.
The problem is that my image is part of the data template of my control and I cannot access the transform object.
<DataTemplate>
<Image Name="displayImage" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="{Binding photo_link}" RenderTransformOrigin="0.5, 0.5" CacheMode="BitmapCache">
<Image.RenderTransform>
<CompositeTransform x:Name="transform" />
</Image.RenderTransform>
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener PinchDelta="OnPinchDelta" PinchStarted="OnPinchStarted" />
</toolkit:GestureService.GestureListener>
</Image>
</DataTemplate>
This method transformcannot be enabled.
private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
{
initialAngle = transform.Rotation;
initialScale = transform.ScaleX;
}
any ideas
thank!
source
share