title: Stretch="uniform" not behaving as expected on Silverlight MediaElement
body: <p>I am using the following XAML to display streaming video through a Silverlight media element:</p>
  
  <pre><code>&lt;UserControl x:Class="slplayer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    Padding="0"&gt;
          &lt;!-- source is set to a custom MediaStreamSource in code behind --&gt;
          &lt;MediaElement Name="mediaElement" HorizontalAlignment="Stretch"
                 VerticalAlignment="Stretch" Margin="0" Stretch="Uniform" /&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>And expect that video should playback and should, depending on the size of the playback window, consume either all available horizontal space or all available vertical space and scale the non-constrained dimension to maintain the aspect ratio of the video.</p>
  
  <p>In the case where the vertical dimension is constrained this is exactly what happens, however (as you can see in the screen shot below) when the horizontal dimension is constrained a significant amount of space is left on either side and the vertical dimension is scaled to this narrower width.</p>
  
  <p>My question is why is the video not consuming all horizontal space?</p>
  
  <p>Things I've tried:</p>
  
  <ul>
  <li>simplifying the layout (which is how I got the above XAML)</li>
  <li>hosting the control in both a web browser and a SilverlightViewportElement</li>
  <li>modifying the dimensions of the mp4 file and video track</li>
  <li>playing the mp4 file in WMP (which scales correctly)</li>
  <li>setting css styles on the html, body, div, and object used</li>
  </ul>
  
  <p>The problem illustrated:</p>
  
  <p><img src="https://i.stack.imgur.com/46M7l.png" alt="The problem illustrated"></p>