title: How to make ListBox editable when bound to a List<string>?
body: <p><strong>Edit</strong>: The basic problem is binding a List to ListBox(or any other control). So I am editing the question.</p>
  
  <p>I bound a list of string to a ListBox as below. However when I change the contents of the textbox it is not changing the string in the source list.Why?</p>
  
  <pre><code>  public partial class MainWindow : Window
  {
      List&lt;string&gt; _nameList = null;
  
      public List&lt;string&gt; NameList
      {
          get
          {
              if (_nameList == null)
              {
                  _nameList = new List&lt;string&gt;();
              }
              return _nameList;
          }
          set
          {
              _nameList = value;
          }
      }
      public MainWindow()
      {
          NameList.Add("test1");
          NameList.Add("test2");
          InitializeComponent();
      }
  </code></pre>
  
  <p>And the XAML</p>
  
  <pre><code> &lt;ListBox Grid.Row="0" Grid.Column="0" DataContext="{Binding ElementName=main}" ItemsSource="{Binding NameList}"&gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;TextBox Text="{Binding .,Mode=OneWayToSource ,  UpdateSourceTrigger=PropertyChanged}"/&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
  </code></pre>