title: How can I use a collection class as a static resource in silverlight
body: <p>I have a simple class named <code>Customer</code> with 2 properties.<br/>
  <code>public Name {get;set;}<br/>public LastName {get;set}</code><br/>
  Then I made a collection class named <code>CustomerList</code> with only one public property named Customers</p>
  
  <pre><code>public class CustomerList
  {
      public List&lt;Customer&gt; Customers { get; set; }
  
      public CustomerList()
      {
          Customers = new List&lt;Customer&gt;();
          Customers.Add(new Customer() { Name = "Foo", LastName = "Bar" });
          Customers.Add(new Customer() { Name = "Foo1", LastName = "Bar1" });
      }
  }
  </code></pre>
  
  <p>Now I want to use this class as a static resouce in XAML.</p>
  
  <pre><code>  &lt;UserControl.Resources&gt; 
    &lt;customers:CustomerList x:Key="CustomersKey"&gt;
    &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>and then use it in a ListBox</p>
  
  <pre><code> &lt;ListBox x:Name="lvTemplate" ItemsSource="{Binding Source={StaticResource CustomersKey}}"&gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel&gt;
                      &lt;TextBox Text="{Binding Name}"/&gt;
                      &lt;TextBox Text="{Binding LastName}"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>if I set the ItemsSource in code behide, after instantiating the class, all work fine. If I try to set it from XAML and the static resource Nothing happens. not even if I use the <code>{Binding Path=Customer.Name}</code> or <code>{Binding Path=Name}</code>.</p>
  
  <p>Clearly I miss something...</p>