title: Wpf listbox binding with string array
body: <p>i have a listbox and this my xaml code;</p>
  
  <pre><code>        &lt;ListBox x:Name="DepremlerListesi" Margin="0,0,542,14"&gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid Width="332" Background="#4CFFFFFF"&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="132*"/&gt;
                          &lt;ColumnDefinition Width="200*"/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition/&gt;
                          &lt;RowDefinition Height="40"/&gt;
                          &lt;RowDefinition/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Grid Grid.RowSpan="3" Margin="0,0,12,0"
                            Background="Orange"
                            Width="120"
                            Height="120"
                            HorizontalAlignment="Left"&gt;
                          &lt;TextBlock Text="{Binding XX}"
                                     HorizontalAlignment="Center"
                                     VerticalAlignment="Center"
                                     FontSize="48" Foreground="White"/&gt;
                      &lt;/Grid&gt;
                      &lt;TextBlock Grid.Column="1" Grid.ColumnSpan="3"
                                 Text="{Binding YY}"
                                 FontSize="16"
                                 VerticalAlignment="Center"/&gt;
                      &lt;TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="Başlık" TextWrapping="Wrap"/&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
  
          &lt;ListBox.ItemContainerStyle&gt;
              &lt;Style TargetType="ListBoxItem"&gt;
                  &lt;Setter Property="Padding" Value="0"/&gt;
                  &lt;Setter Property="Margin" Value="6"/&gt;
              &lt;/Style&gt;
          &lt;/ListBox.ItemContainerStyle&gt;
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>There is a string array in my hand. I want to add this array and that ListBox. I've searched a lot but I couldn't find enough information.</p>
  
  <p>I tried (<a href="https://stackoverflow.com/questions/2737009/fill-wpf-listbox-with-string-array">this</a> page) the answers on the following page,</p>
  
  <pre><code>        ObservableCollection&lt;string&gt; oList;
          oList = new ObservableCollection&lt;string&gt;(MyArray);
          DepremlerListesi.DataContext = oList;
  
          Binding binding = new Binding();
          DepremlerListesi.SetBinding(ItemsControl.ItemsSourceProperty,binding);
  
          (DepremlerListesi.ItemsSource as ObservableCollection&lt;string&gt;).RemoveAt(0);
  </code></pre>
  
  <p>but the result (<em>the yellow boxes are empty</em>);</p>
  
  <p><a href="https://i.stack.imgur.com/vLCGu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vLCGu.png" alt="enter image description here"></a></p>
  
  <p>the values it's supposed to be this way;</p>
  
  <p><a href="https://i.stack.imgur.com/CGU0d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CGU0d.png" alt="enter image description here"></a></p>
  
  <p>With the list maybe it could be, but I don't know how. (<a href="http://www.wpf-tutorial.com/list-controls/listbox-control/" rel="nofollow noreferrer">this</a> article)</p>
  
  <p>If you're wondering if what I want to do, i have a work on earthquakes. This data is the severity of the earthquake. I'm curious about solution suggestions. I hope my broken English with i told description. Thanks.</p>