title: How to set a relative path/Uri in ResourceDictionary's source
body: <p>I am trying to refer to a MergedDictionaries.SharedStyles project which has all Styles that has to be used allover application. So here i have different styles under different folders as Resource Dictionaries. so finally i have Merged them into AllSharedStyles.xaml and have that at Styles project level.</p>
  
  <p>Now I have another ResourceDictionary at Solution level &lt;> which refers to AllSharedStyles.xaml resource dictionary &lt;&lt;>>. This ResourceDictionary is added as a link to all my modules in solution. </p>
  
  <p>Issue here is In my SharedResourceDictionary i am having following MergedDictionaries</p>
  
  <pre><code>&lt;ResourceDictionary.MergedDictionaries&gt;
      &lt;ResourceDictionary Source="/MergedDictionaries.SharedStyles;component/AllSharedStyles.xaml" /&gt;
      &lt;ResourceDictionary Source="/View/LocalResource.xaml" /&gt; 
  &lt;/ResourceDictionary.MergedDictionaries&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Qbdly.png" alt="Project architecture"></p>
  
  <p>I have refered to common Resource first then my local inorder to override(only if required) any styles specific to module.</p>
  
  <p>Now  when i run the application it complains </p>
  
  <pre><code>'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '5' and line position '10'.
  </code></pre>
  
  <p>Thats the error message.</p>
  
  <p>With my understanding it is looking for proper reference. I also tried using Pack URL ref: <a href="http://msdn.microsoft.com/en-us/library/aa970069.aspx">Pack URLss</a>.
  Here is the pack url:</p>
  
  <pre><code> &lt;ResourceDictionary Source="pack://application:,,,/MergedResourceDictionaries.Styles;component/component/AllSharedStyles.xaml" /&gt;
  </code></pre>
  
  <p>So any suggestions on How to have a relative path here????</p>
  
  <p>Sorry for my description/projection of problem</p>