title: C# WPF Media Video Player doesn't start
body: <p>I try to make a Media Player on WPF.</p>
  
  <p>I made this yet  :</p>
  
  <pre><code>     public partial class MyMediaPlayer : Window
      {
          public MyMediaPlayer()
          {
              InitializeComponent();
  
              //
  
              OpenFileDialog dlg = new OpenFileDialog();
              dlg.InitialDirectory = "c:\\"; // init
  
              dlg.Filter = "All Files (*.*)|*.*"; // filter
              dlg.RestoreDirectory = true;
              // dialog window
            if (dlg.ShowDialog() == true) // checked ? 
              {
                  string selectedFileName = dlg.FileName; // path of the media
                  MediaPlayer player = new MediaPlayer();
                  player.Open(new Uri(selectedFileName, UriKind.Relative));
                  VideoDrawing aVideoDrawing = new VideoDrawing();
                  aVideoDrawing.Rect = new Rect(0, 0, 100, 100);
                  aVideoDrawing.Player = player; // play
                  // never play
                  player.Play();
              }
          }
      }
  </code></pre>
  
  <p>And the XAML file : </p>
  
  <pre><code>    &lt;Window ... &gt;
      &lt;Grid&gt;
          &lt;MediaElement Margin="10,10,10,0 " Source="D:\test.avi"
                                Name="McMediaElement"
                   Width="450" Height="250" LoadedBehavior="Manual" UnloadedBehavior="Stop" Stretch="Fill"
                   /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>But, the video never start, and the window stay white.</p>
  
  <p>Help please :) </p>
  
  <p>ps : sorry for my bad english</p>