title: Can't retrieve WPF application resource if there is only one
body: <p>Is ths a bug in my code or in WFP? Using VisualStudio 2013, targeting .NET 4.5.1.</p>
  
  <pre><code>&lt;Application x:Class="WPFDemo.MyApp"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:vm="clr-namespace:WPFDemo.ViewModels"&gt;
  
      &lt;Application.Resources&gt;
          &lt;vm:TestClass x:Key="tc" /&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  
     public partial class MyApp : Application
     {  
        protected override void OnStartup(StartupEventArgs e)
        {
           base.OnStartup(e);
           var mainWindow = new MainWindow();
           mainWindow.Show();
        }
     }
  
     public partial class MainWindow
     {
        public MainWindow()
        {
           InitializeComponent();
           object o = Application.Current.Resources["tc"];
        }
     }
  </code></pre>
  
  <p>Problem: o is null. </p>
  
  <p>If I add at least one other resource of any type:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;vm:TestClass x:Key="tc" /&gt;
      &lt;vm:TestClass2 x:Key="tc2" /&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>and make no other changes anywhere, o comes back as an instance of TestClass.</p>
  
  <p>Huh?</p>