title: How to use ResourceDictionary as StaticResource in Windows Phone 8
body: <p>I have a Windows Phone 7 app which I'm trying to create a Windows Phone 8 version of it.</p>
  
  <p>In the app I have a ResourceDictionary defined in a XAML file as:</p>
  
  <pre><code>&lt;ResourceDictionary
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:sys="clr-namespace:System;assembly=mscorlib"&gt;
  
      &lt;sys:String x:Key="AppName"&gt;My App Name&lt;/sys:String&gt;
      &lt;!-- etc. --&gt;
  
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>This ResourceDictionary is referenced in App.xaml as:</p>
  
  <pre><code>&lt;!--Application Resources--&gt;
  &lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="Assets/Constants.xaml"/&gt;
              &lt;!-- etc. --&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>And then the easy part of doing:</p>
  
  <pre><code>&lt;TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}"/&gt;
  </code></pre>
  
  <p>The above works perfectly fine with Windows Phone 7, however, in Windows Phone 8 there is an additional <code>Application.Resources</code> item which is <code>&lt;myNamespace:LocalizedStrings x:Key="LocalizedStrings"/&gt;</code> which when I have my app does not compile as it complains about</p>
  
  <blockquote>
    <p>Each dictionary entry must have an associated key.</p>
  </blockquote>
  
  <p>So I changed by code to be:</p>
  
  <pre><code>&lt;!--Application Resources--&gt;
  &lt;Application.Resources&gt;
      &lt;myNamespace:LocalizedStrings x:Key="LocalizedStrings"/&gt;
      &lt;ResourceDictionary x:Key="MainDictionary"&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="Assets/Constants.xaml"/&gt;
              &lt;!-- etc. --&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>Now I have another problem. My app compiles but when it runs it throws a <code>XamlParseException</code>:</p>
  
  <blockquote>
    <p>Cannot find a Resource with the Name/Key AppName</p>
  </blockquote>
  
  <p>This all happens because of <code>LocalizedStrings</code> resource. Can someone help in making that work?</p>
  
  <p>By the way, I have the same issue with the Value Converters; if they are done differently I appreciate if someone can help in that as well.</p>
  
  <p>Thanks in advance.</p>