title: Add items dynamically to ResourceDictionary. Convert File path to resource Key
body: <p>I have ResourceDictionary in my application. I need to add some items from c# code to this collection:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>As key for resources i want to use path to file. 
  For example:</p>
  
  <p>c:\some folder\@#file.txt</p>
  
  <p>What is the best wey to convert this file path to valid ResourceDictionary Key?</p>