title: wpf binding listbox items to a static list
body: <p>I really looked hard. There seems to be something I am missing. Using .net 4.5.</p>
  
  <p>Here's my XAML:</p>
  
  <pre><code>&lt;Window x:Class="a.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:a"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;ListBox x:Name="myListBox" HorizontalAlignment="Left" Height="201" Margin="144,33,0,0" VerticalAlignment="Top" Width="115" ItemsSource="{Binding (local:myClass.myStaticList)}"/&gt;
          &lt;Button Content="Button" HorizontalAlignment="Left" Height="48" Margin="282,247,0,0" VerticalAlignment="Top" Width="150" Click="Button_Click"/&gt;
  
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>and here's the code behind:</p>
  
  <pre><code>using System.Collections.ObjectModel;
  using System.Windows;
  
  namespace a
  {
      public class myClass
      {
          public static ObservableCollection&lt;string&gt; myStaticList { get; set; }
      }
  
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
  
              myListBox.Items.Add("aaa");
              myListBox.Items.Add("bbb");
              myListBox.Items.Add("ccc");
              myListBox.Items.Add("ddd");
              myListBox.Items.Add("eee");
              myListBox.Items.Add("rrr");
  
          }
  
          private void Button_Click(object sender, RoutedEventArgs e)
          {
              &lt;--- Breakpoint here
          }
      }
  }
  </code></pre>
  
  <p>Real simple.
  The button is used only to pause the running with a breakpoint and see whether the data was introduced from <code>myListBox</code> to <code>myControl.myList</code>.</p>
  
  <p>It doesn't. <code>myList</code> remains null. What am I missing?</p>
  
  <p>Help please!
  TIA</p>