title: Problems with binding a static ObservableCollection
body: <p>I have a class (very little code for testing purposes) which contains a static <code>ObservableCollection</code>, which gets populated from elsewhere:</p>
  
  <pre><code>public class TestClass
  {
      public static ObservableCollection&lt;int&gt; TestCollection = new ObservableCollection&lt;int&gt;();
  }
  </code></pre>
  
  <p>... and a basic WPF window with a <code>ListBox</code>:</p>
  
  <pre><code>&lt;Window x:Class="app.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;ListBox x:Name="list"/&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>When I tried binding programmatically:</p>
  
  <pre><code>list.ItemsSource = Containers.TestClass.TestCollection;
  </code></pre>
  
  <p>... it worked just fine.  However, when I try to perform binding through XAML:</p>
  
  <pre><code>&lt;Window x:Class="app.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="clr-namespace:app.Containers"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Window.Resources&gt;
          &lt;d:TestClass x:Key="dataSource"/&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;ListBox x:Name="list" ItemsSource="{Binding Source={StaticResource dataSource}, Path=TestCollection}"/&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>... nothing gets displayed.</p>
  
  <p>I've also tried setting <code>DataContext</code>:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;l:LifeEngine x:Key="dataSource"/&gt;
  &lt;/Window.Resources&gt;
  &lt;Window.DataContext&gt;
      &lt;Binding Source="{StaticResource dataSource}"/&gt;
  &lt;/Window.DataContext&gt;
  </code></pre>
  
  <p>...and using path...</p>
  
  <p></p>
  
  <p>...and nothing gets displayed once again.</p>
  
  <p>Also, not sure if it matters, but when I make my class <code>static</code> I get an error in my XAML code saying:</p>
  
  <blockquote>
    <p>The type 'TestClass' is abstract and must include an explicit value.</p>
  </blockquote>
  
  <p>So, that's out of the question.</p>
  
  <p>Any idea how I can bind that <code>ObservableCollection</code> through XAML?</p>