title: WPF Can't find local resource when executed
body: <p>I'm defining an application resource in my app that stores my ViewModels with a navigation element to navigate pages. This is working fine in the xaml editor of visual studio since all the data bindings are working there. However when I try to run the application in debugger it trows an Exception with the message <code>Cannot find source with the name ViewModelLocator.</code> Does anyone know what is going wrong?</p>
  
  <p>I have a local resource defined in my App.xaml like this:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;viewmodel:ViewModelLocator x:Key="ViewModelLocator"/&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>Which i try to use like this:</p>
  
  <pre><code>&lt;Page x:Class="QardPrint.PageEmployeesList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="clr-namespace:QardPrint"
    xmlns:viewmodel="clr-namespace:QardPrint.ViewModel"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300"
    Title="PageEmployeesList"
    DataContext="{Binding EmployeesListViewModel, Source={StaticResource ViewModelLocator}}"&gt;
  </code></pre>
  
  <p>My ViewModelLocator class looks like this</p>
  
  <pre><code>public class ViewModelLocator
  {
      public EmployeesListViewModel EmployeesListViewModel =&gt; new EmployeesListViewModel(App.Navigation);
  }
  </code></pre>