title: Horizontal scrolling a row of ViewBox images in Xaml
body: <p>I'm working on a UWP Windows 10 app with a XAML UI. One of my pages requires that images fill the height of the window (or screen in tablet mode) and uniformly scale as one long row of images from left to right (going off-screen). I've got this set up perfectly using ViewBoxes for the images inside of a StackPanel set to a Horizontal Orientation like so:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal"&gt;
      &lt;Viewbox&gt;
          &lt;Image Source="http://lorempixel.com/200/200/" /&gt;
      &lt;/Viewbox&gt;
      &lt;Viewbox&gt;
          &lt;Image Source="http://lorempixel.com/400/600/" /&gt;
      &lt;/Viewbox&gt;
      &lt;Viewbox&gt;
          &lt;Image Source="http://lorempixel.com/700/700/" /&gt;
      &lt;/Viewbox&gt;
      &lt;Viewbox&gt;
          &lt;Image Source="http://lorempixel.com/100/300/" /&gt;
      &lt;/Viewbox&gt;
      &lt;Viewbox&gt;
          &lt;Image Source="http://lorempixel.com/100/500/" /&gt;
      &lt;/Viewbox&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>The intention is for the images to flow off-screen with a horizontal scroll that allows the user to pan from left to right to see the gallery of images as one long row. </p>
  
  <p>I've tried enabling HorizontalScrollMode on the parent StackPanel like so:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollMode="Enabled"&gt;
  </code></pre>
  
  <p>But this did not enable any scrolling at all.</p>
  
  <p>I also tried to wrap everything inside of a ScrollViewer like so:</p>
  
  <pre><code>&lt;ScrollViewer HorizontalScrollMode="Enabled"&gt;
      &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;Viewbox&gt;
              &lt;Image Source="http://lorempixel.com/200/200/" /&gt;
          &lt;/Viewbox&gt;
          &lt;Viewbox&gt;
              &lt;Image Source="http://lorempixel.com/400/600/" /&gt;
          &lt;/Viewbox&gt;
          &lt;Viewbox&gt;
              &lt;Image Source="http://lorempixel.com/700/700/" /&gt;
          &lt;/Viewbox&gt;
          &lt;Viewbox&gt;
              &lt;Image Source="http://lorempixel.com/100/300/" /&gt;
          &lt;/Viewbox&gt;
          &lt;Viewbox&gt;
              &lt;Image Source="http://lorempixel.com/100/500/" /&gt;
          &lt;/Viewbox&gt;
      &lt;/StackPanel&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>But this completly breaks my ViewBox layout by shrinking all the images so they fit within a small portion of the screen and no longer fill the window/tablet height.</p>
  
  <p>I've tried a number of other variations with similar results. Does anyone have some suggestions for solving this? Let me know if you need more info.</p>