title: TranslateTransform cancels ScaleTransform
body: <p>I'm new to WPF and after quite a bit of playing I finally got my controls arranged the way I'd like on the Project I'm working. I have a rectangle which displays an image. Mouse-wheel scales the image with <code>ScaleTransform</code> animation and mouse click/drag moves the image around the screen. The problem is if I scale the image up or down and then try to move it, it automatically scales it self back to 1(original size). Is there any way to move it around in when it's scaled?
  Edit: I tried setting ScaleTransform and TranslateTransform to TransformGroup, but still it didn't work.</p>
  
  <p>The other problem I'm having is if the image is larger than the parent container, it falls out of bounds, I tried setting <code>ClipToBounds = True</code> on parent containers, but it didn't work.</p>
  
  <p>Code: </p>
  
  <pre><code>private void Window_MouseWheel_1(object sender, MouseWheelEventArgs e)
  {
      if (e.Delta &gt; 0)
      {
          ScaleTransform scaleP = new ScaleTransform();
          scaleP.CenterX = e.GetPosition(this).X;
          scaleP.CenterY = e.GetPosition(this).Y;
  
          rect.RenderTransform = scaleP;
  
          DoubleAnimation dblAnimX = new DoubleAnimation();
          dblAnimX.From = scaleXFrom;
          dblAnimX.To = scaleXTo + 0.1;
          scaleXFrom = scaleXTo +0.1;
          scaleXTo += 0.1;
          Duration = new Duration(TimeSpan.FromSeconds(0.15));
  
          DoubleAnimation dblAnimY = new DoubleAnimation();
          dblAnimY.From = scaleYFrom;
          dblAnimY.To = scaleYTo + 0.1;
          scaleYFrom = scaleYTo +0.1;
          scaleYTo += 0.1;
          Duration = new Duration(TimeSpan.FromSeconds(0.15));
  
          scaleP.BeginAnimation(ScaleTransform.ScaleXProperty, dblAnimX);
          scaleP.BeginAnimation(ScaleTransform.ScaleYProperty, dblAnimY);
      }
      else
      {
          ScaleTransform scaleM = new ScaleTransform();
          scaleM.CenterX = e.GetPosition(this).X;
          scaleM.CenterY = e.GetPosition(this).Y;
  
          rect.RenderTransform = scaleM;                           
  
          DoubleAnimation dblAnimX = new DoubleAnimation();
          dblAnimX.From = scaleXFrom;
          dblAnimX.To = scaleXTo -0.1;
          scaleXFrom = scaleXTo -0.1;
          scaleXTo -= 0.1;
          dblAnimX.Duration = new Duration(TimeSpan.FromSeconds(0.15));
  
          DoubleAnimation dblAnimY = new DoubleAnimation();
          dblAnimY.From = scaleYFrom;
          dblAnimY.To = scaleYTo - 0.1;
          scaleYFrom = scaleYTo -0.1;
          scaleYTo -= 0.1;
          Duration = new Duration(TimeSpan.FromSeconds(0.15));
  
          scaleM.BeginAnimation(ScaleTransform.ScaleXProperty, dblAnimX);
          scaleM.BeginAnimation(ScaleTransform.ScaleYProperty, dblAnimY);
      }
  }
  
  private void rect_MouseMove_1(object sender, MouseEventArgs e)
  {
      if (e.LeftButton == MouseButtonState.Pressed)
      {
          System.Windows.Point p = e.GetPosition(this);
          TranslateTransform tt = new TranslateTransform();
          tt.X = (p.X - mouseDownX);
          tt.Y = (p.Y - mouseDownY);
  
          rect.RenderTransform = tt;
  
      }
  }
  </code></pre>