title: WPF: Why MediaElement in PopUp can't size to Screen Height?
body: <p>&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;<img src="https://i.stack.imgur.com/b7dmx.png" alt="MediaElement"></p>
  
  <p>I have <code>MediaElement</code> control inside a <code>PopUp</code>. When I resize MediaElement to wide screen, it is cut a area in the bottom (see the image).</p>
  
  <p>What do I do wrong? How to fix it? Thank you very much!</p>
  
  <p>XAML:</p>
  
  <pre><code>    &lt;Popup PlacementRectangle="-500,0,0,0" Placement="Relative" IsOpen="True" Name="popup"&gt;
          &lt;MediaElement Name="me" Width="480" Height="360" Volume="1"
              MouseLeftButtonUp="me_MouseLeftButtonUp"/&gt;
      &lt;/Popup&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    bool fullscreen = false;
      private void me_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
      {
          fullscreen = !fullscreen;
          if (fullscreen)
          {
              popup.PlacementRectangle = new Rect(0, 0, 0, 0);
              popup.Placement = PlacementMode.Absolute;
              me.Width = Screen.PrimaryScreen.Bounds.Width;
              me.Height = Screen.PrimaryScreen.Bounds.Height;
          }
          else
          {
              popup.PlacementRectangle = new Rect(-500, 0, 0, 0);
              popup.Placement = PlacementMode.Relative;
              me.Width = 480;
              me.Height = 360;
          }
      }
  </code></pre>