title: RecourceDictionaries and custom converters
body: <p>I have a WPF Application containing MainWindow which just display a MainUserControl and it also contains App.xaml with Merged dictionaries:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary Source="Resources\Styles.xaml"/&gt;
                  &lt;ResourceDictionary Source="Resources\DataTemplates.xaml"/&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>Then I decided to use MainUserControl in another project where it should be displayed in the ElementHost. Unfortunately, it doesn’t work because styles and DataTemplates from the resource dictionaries are not found. I don’t know the right way to solve it out but I decided that I may move code ResourceDictionaries code into the MainUserControl’s resources:  </p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;!-- the same code --&gt; 
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>It caused the error with my converters I used in Resource dictionaries - Cannot create unknown type '{clrnamespace:MyApplication.Converters;assembly=MyApplication}LengthToStringConverter
  . I tried to move converters outside the resource dictionaries by adding one more ResourceDictionary with my converters:</p>
  
  <pre><code>        &lt;ResourceDictionary&gt;
              &lt;con:LengthToStringConverter x:Key="textConverter"/&gt;
              &lt;con:DateToTextConverter x:Key="dateConverter"/&gt;
          &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>It also caused a xaml exception (Provide value on 'System.Windows.StaticResourceExtension' threw an exception.).</p>
  
  <p>So what I’m looking for is the way to solve problem with converters which could not be found in the resource dictionaries or another way to solve problem with using MainUserControl class in another project (it can’t find resources at all, perhaps, there is a way to specify them?).</p>