title: StaticResource works in design, throws XamlParseException at runtime
body: <p>This seems so silly, but I've been looking for a couple of hours and nothing I find fixes this problem.</p>
  
  <p>I'm using MvvmLight.  I have a simple MainWindow that has nothing in it but a Grid.  I have another class that is a WPF UserControl that contains one button.  Both of these have</p>
  
  <pre><code>DataContext="{Binding Main, Source={StaticResource Locator}}"
  </code></pre>
  
  <p>in their node definition (either Window or UserControl).  App.xaml has the standard entry in its Resources:</p>
  
  <pre><code>&lt;vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /&gt;
  </code></pre>
  
  <p>I'm playing with messaging, and I've got a message that says load this UserControl in the MainWindow.  I can trace through and everything works just peachy -- right up to the point where it is instantiating the new UserControl and the code behind does its InitializeComponent().</p>
  
  <p>At this point the application stops in the user control's .xaml file with the XamlParseException complaining it cannot find "Locator" (and, yes, I know, resource names are case sensitive, thank you).</p>
  
  <p>This makes absolutely no sense to me.  In design mode in the user control, I can navigate to the data context I want -- it sees Locator, and Locator sees Main, and Main sees the property I'm binding to the button.  And the designer SHOWS the text on the button.</p>
  
  <p>Anybody???</p>
  
  <p>This is C# in VS 2010 Ultimate, v10.0.30319.1, running in Windows 7.</p>