title: Successfully referencing ResourceDictionary in file being loaded by XamlReader.Load()
body: <p>I am building a common WP7 assembly which will display common help/about information for my apps, each app assembly will specify a pair of StackPanels which have some of the app specific information (well call em Legal.xaml and WhatsNew.xaml).</p>
  
  <p>Ideally these app specific XAML files should be in a plaintext form (vs something that is instantiated in code) so loadable via HTTP or as an embedded resource string.</p>
  
  <p>Loading the XAML works fine, until I try to break out some of the style definitions into another file, then XamlReader.Load() fails with a note that: “Attribute AboutPageDocs/CommonStyles.xaml value is out of range. [Line: 43 Position: 45]”</p>
  
  <p>That error would happen when loading Legal.xaml, which when we look around like 43 we find where I am attempting to load the ResourceDictionary that now contains the custom styles:</p>
  
  <pre><code>&lt;StackPanel.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="AboutPageDocs/CommonStyles.xaml"/&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/StackPanel.Resources&gt;
  </code></pre>
  
  <p>Here is the bugger... if simply copy &amp; paste the StackPanel code (which is being loaded dynamically at runtime) and drop it into a UserControl... things work fine.</p>
  
  <p>Short of having to define my styles inline in both Legal.xaml &amp; WhatsNew.xaml... is there any way to have XamlReader.Load() property lookup CommonStyles.xaml?</p>
  
  <p>On the thought that the Source path was not correct, I have tried placing copies of CommonStyles.xaml in various locations through both assemblies... as well as experimented with the pack:// uri syntax... all to no avail thus far.</p>
  
  <p>What am I missing?</p>