title: How to bind data to ListBox Control dynamically?
body: <p>I am developing window phone 7 application. I am new to the silverlight. I am trying to bind a List of strings to Listbox. I am using the following code</p>
  
  <pre><code>ObservableCollection&lt;String&gt; abc = new ObservableCollection&lt;String&gt;();
              abc.Add("XYZ");
              IncomeSummaryListBox.ItemsSource = abc;
  </code></pre>
  
  <p>My xaml contains the following code</p>
  
  <pre><code>&lt;ListBox Margin="16,217,6,275" Name="IncomeSummaryListBox"&gt;
                  &lt;ListBox.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;
  
                          &lt;/StackPanel&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ListBox.ItemTemplate&gt;
              &lt;/ListBox&gt;
  </code></pre>
  
  <p>With the above code my listbox shows no items at runtime. My emulator device doesn't show anything in listbox. What is wrong in my code ? Can you please provide me any code or link for the above issue so that I can resolve the above issue ? If I am doing anything wrong then please guide me.</p>