title: ListBox.ItemsSource binding in code and in xaml
body: <p>I wrote simple code like </p>
  
  <pre><code>public ObservableCollection&lt;string&gt; Names …
  public Window1()
  {
      PutInDataIntoNames();
      InitializeComponent();
      this.listBox1.ItemsSource = Names;
  }
  </code></pre>
  
  <p>and in xaml </p>
  
  <pre><code>&lt;Grid&gt;
      &lt;ListBox Margin="10,11,10,16"
           Name="listBox1"
           Background="Black" 
           Foreground="Orange" 
           /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Then I wanted to set ItemsSource property in xaml. In order to do that I wrote the following:</p>
  
  <pre><code>ItemsSource="{Binding Path=Names}"
  </code></pre>
  
  <p>Unfortunately, it doesn’t work. Could you explain why and how to do that right?</p>