title: MVVM Light ViewModelLocator
body: <p>I am using MVVM Light in my application, with multiple assemblies in the solution. 
  How can I have a ViewModelLocator in each assembly without defining in App.xaml resources?</p>
  
  <p>Typically ViewModelLocator is defined like this:</p>
  
  <pre><code>&lt;Application.Resources&gt;
    &lt;ResourceDictionary&gt;
     &lt;ResourceDictionary.MergedDictionaries&gt;
       &lt;ResourceDictionary Source="/Sol1;component/GlobalResources.xaml" /&gt;
     &lt;/ResourceDictionary.MergedDictionaries&gt;
     &lt;viewModels:ViewModelLocator xmlns:main="clr-namespace:MainModule.ViewModel;assembly=MainModule" x:Key="Locator" d:IsDataSource="True"/&gt; 
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p></p>
  
  <p>I created a Resources.xaml in a class library within my solution like this:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:ModuleX="clr-namespace:ModuleX"&gt;
  &lt;ResourceDictionary.MergedDictionaries&gt;
      &lt;ResourceDictionary Source="/Common;component/CommonResources.xaml" /&gt;
  &lt;/ResourceDictionary.MergedDictionaries&gt;
  &lt;ModuleX:ViewMoldelLocator x:Key="ModuleXLocator" /&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>However, ModuleXLocator is not found:</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage
         ...
         DataContext="{Binding Main, Source={StaticResource ModuleXLocator}}"&gt;
  </code></pre>