title: Canvas Image. TranslateTransform loses the image in some cases
body: <p>I have a Canvas with Image.</p>
  
  <pre><code>&lt;Canvas
      x:Name="ImageCanvas"
      SizeChanged="Root_OnSizeChanged"&gt;
      &lt;Canvas.Clip&gt;
          &lt;RectangleGeometry
              x:Name="RootGeometry"/&gt;
      &lt;/Canvas.Clip&gt;
  
      &lt;Image
          x:Name="Image"
          Source="{Binding TestData, Converter={StaticResource TestDataToBitmapConverter} }" 
          HorizontalAlignment="Left"
          VerticalAlignment="Top"
  
          ManipulationStarted="OnManipulationStarted"
          ManipulationDelta="OnManipulationDelta"
          ManipulationCompleted="OnManipulationCompleted"
          Stretch="None"
          ImageOpened="OnImageOpened"&gt;
          &lt;Image.RenderTransform&gt;
              &lt;TransformGroup&gt;
                  &lt;MatrixTransform x:Name="previousTransform" /&gt;
                  &lt;TransformGroup x:Name="currentTransform"&gt;
                      &lt;ScaleTransform x:Name="scaleTransform" /&gt;
                      &lt;RotateTransform x:Name="rotateTransform" /&gt;
                      &lt;TranslateTransform x:Name="translateTransform" /&gt;
                  &lt;/TransformGroup&gt;
              &lt;/TransformGroup&gt;
          &lt;/Image.RenderTransform&gt;
      &lt;/Image&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>When i move image on the screen it's still possible to lose it. I use GetSquare to check the  remaining image square and if the square is very small i try to push the image back  </p>
  
  <pre><code>private double GetSquare()
  {
      Rect rect = Utils.GetBounds(Image, ImageCanvas);
      var canvasRect = RootGeometry.Rect;
      canvasRect.Intersect(rect);
      return canvasRect.Height * canvasRect.Width;
  }
  
  double maxSquare=30000;
  double allowedSquare=40000;
  
  private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
  {
      double square = GetSquare();
  
      if (square &lt; maxSquare || double.IsInfinity(square))
      {
          e.Complete();
  
          int counter = 0;
  
          while (GetSquare() &lt;= allowedSquare)
          {
              counter++;
  
              translateTransform.X -= 100 * e.Velocities.Linear.X;
              translateTransform.Y -= 100 * e.Velocities.Linear.Y;
  
              if (counter &gt; 10)
              {  
                  ToInitState();
                  return;
              }
          }
      }
      else
      {
          translateTransform.X += e.Delta.Translation.X;
          translateTransform.Y += e.Delta.Translation.Y;
      }
  
      //Rotate
      rotateTransform.Angle += e.Delta.Rotation;
  
      //Scale
      double deltaScale = e.Delta.Scale;
      double newScale = Utils.GetImageCurrentScale(Image) * deltaScale;
  
      if (newScale &lt; Utils.MAX_ZOOM &amp;&amp; newScale &gt; Utils.MIN_ZOOM)
      {
          scaleTransform.ScaleX *= deltaScale;
          scaleTransform.ScaleY *= deltaScale;
      }
  }
  </code></pre>