title: Add a WPF XAML resourcedictionary to a DLL
body: <p>Maybe I'm misunderstanding how this all works and you can't really stuff plain old XAML files into a DLL as data which can be grabbed out later - but I thought this was possible.</p>
  
  <p>I have tried over and over and over again for like five hours to get this to work so I'm finally asking Stack Overflow.</p>
  
  <p>I have a XAML file in a WPF User Control Library project.  In a perfect world, I should be able to have this XAML file embedded in some way into the DLL for reference in another project.  I don't want to link to the original project folder or anything like that if possible just to keep everything nice and simple and in one place.</p>
  
  <p>So here are the questions that are tripping me up:</p>
  
  <ol>
  <li><p>If you compile a DLL with a file in the project that's compile mode is set to "resource" - does that file actually get stuffed into the DLL? If it doesn't - is there a way to do that?</p></li>
  <li><p>Say my resource file is pathed as such in the Class Library project:</p>
  
  <p>"MyClassLibrarySolutionRoot/StyleXAMLs/Styles.xaml"</p></li>
  </ol>
  
  <p>What do I put for the URI path in the application file:</p>
  
  <pre><code>     &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="What on earth am I supposed to put here?"&gt;&lt;/ResourceDictionary&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>Thanks in advance!  FYI this particular problem has made me a bit batty regarding trying to learn XAML because failure to make it work really breaks the workflow I like to have by basically throwing absolutely everything except the base application's code into class libraries.  So, maybe you can restore my faith in XAML by assuring me I can still easily use and reference DLLs?</p>
  
  <p>PS... I have tried this exact format for the URI over and over and it doesn't work: pack://application:,,,/externalDllName;component/path/dictionary.xaml</p>
  
  <p>Is "component" supposed to be the word "component" or is it supposed to be something else like "ResourceDictionary"?  Is that "path" supposed to be the names of the folders in the original DLL project or something else?</p>
  
  <p>Here, I decided to include a picture because I have no idea what I'm doing wrong:</p>
  
  <p><img src="https://i.stack.imgur.com/xjHSW.png" alt="enter image description here"></p>