title: WPF throws "Cannot locate resource" exception when loading the image
body: <p>I am having a WPF window, with a background image of one file in my local system. So the XAML file looks like this:</p>
  
  <pre><code> &lt;Window.Background&gt;
      &lt;ImageBrush ImageSource="/MYASSEMBLY;component/Resources/MyPic.png"/&gt;
   &lt;/Window.Background&gt;
  </code></pre>
  
  <p>In the XAML designer it actually shows this background image, so the image does exist in MYASSEMBLY\Resources folder. However, in the <code>InitializeComponent()</code> function call when I launch the application, it throws the exception</p>
  
  <blockquote>
    <p>Cannot locate resource 'resources/mypic.png'.</p>
  </blockquote>
  
  <p>So I am totally lost now. Are the directories different between the design and runtime so doesn't exist in the runtime?</p>