title: WPF - Uri to content images
body: <p>I spent 1 hour on browsing internet and trying to find a way how to load Uri to content image and create an BitmapImage.</p>
  
  <p>That is what I have:</p>
  
  <pre><code>{
      Uri x = new Uri("/Images/appbar.chevron.up.png", UriKind.Relative);
      BitmapImage bi = new BitmapImage(x);
      return x;
  }
  </code></pre>
  
  <p>Images in Solution Explorer are just under project:</p>
  
  <p><img src="https://i.stack.imgur.com/4CVel.png" alt="enter image description here"></p>
  
  <p>And each image have Build Action as Content</p>
  
  <p><img src="https://i.stack.imgur.com/odFh9.png" alt="enter image description here"></p>
  
  <p>I'm recieving <code>The given System.Uri cannot be converted into a Windows.Foundation.Uri. Please see http://go.microsoft.com/fwlink/?LinkID=215849 for details.</code> on creating BitmapImage, but debugger showes me that Uri was created:</p>
  
  <p><img src="https://i.stack.imgur.com/8hSjo.png" alt="enter image description here"></p>
  
  <p>Please tell me, how can I load selected image?</p>