title: WPF Application Relative path to a mp3 sound file
body: <p>I'm building a WPF project with Visual Studio 2012 and I'm finding a problem with relative paths.</p>
  
  <p>In the specific, I want a sound to be played when a ToggleButton is checked.</p>
  
  <p>This is the code for my button:</p>
  
  <pre><code>&lt;ToggleButton Name="Circles" Margin="88,104,86,172" Background="#FFFFD0CD" Foreground="Black" Checked="Circles_Checked"&gt;Circles&lt;/ToggleButton&gt;
  </code></pre>
  
  <p>and if I write like this:</p>
  
  <pre><code>    private void Circles_Checked(object sender, System.Windows.RoutedEventArgs e)
      {
  
      MediaPlayer mplayer = new MediaPlayer();
  
      mplayer.Open(new Uri("C:\\Users\\user1\\Documents\\Visual Studio 2012\\Projects\\RehabilitationGUIProject\\RehabilitationGUIProject\\circles.mp3", UriKind.Relative));
  
      mplayer.Play();
      }
  </code></pre>
  
  <p>everything works as espected. But I want this code to work also onto other machines, not only mine. And what If I have to move the sounds to another location? I would like to use relative paths and move every sound inside my project folder.</p>
  
  <p>So I created a new folder named Sound inside my root project, the structure is like this:</p>
  
  <p>RehabilitationGuiProject<br>
  \Properties<br>
  \References<br>
  \Bin<br>
  \Object<br>
  \Sounds
   \circles.mp3</p>
  
  <p>... other files .xaml</p>
  
  <p>So I wrote the same lines of code above, changing this one:</p>
  
  <pre><code>mplayer.Open(new Uri(@"/Sounds/circles.mp3", UriKind.Relative));
  </code></pre>
  
  <p>But no sound is played. Which is the correct relative path for playing sounds from a project folder?</p>