title: WPF: How to make images scale together
body: <p>I am dynamically adding images using view boxes to a <code>UniformGrid</code>.</p>
  
  <pre><code>for (int i = 0; i &lt; count; i++)
  {
      var viewbox = new Viewbox();
      var filePath = "myFilePath";
  
      if (!File.Exists(filePath)) continue;
  
      var newImage = new Image();
      var bitmapImage = new BitmapImage(new Uri(filePath));
      newImage.Source = bitmapImage;
  
      viewbox.Child = newImage;
      viewbox.SetValue(Grid.RowProperty, i);
  
      ImageGrid.Children.Add(viewbox);
  }
  </code></pre>
  
  <p>The problem I'm running into is where the images are different sizes, horizontally or vertically.</p>
  
  <p>A good way to visualize whats happening. If there's 2 images on screen, with the first image being wider and shorter than the second image.
  When I shrink the window horizontally, the first image will shrink independently its the same width as the second.  Now, when I shrink the window vertically, the second image will shrink independently until its the same height as the first. </p>
  
  <p>How do I make the 2 images scale together without setting the view box stretch property to fill?</p>