title: Binding List to ItemsControl: How to refresh
body: <p>I am binding a List to an ItemsControl. I shows up fine. But when I add a string to the list the control is not updated. I tried to raise the PropertyChanged event to force the update but that does not help. What am I doing wrong?</p>
  
  <p>Here is the XAML:</p>
  
  <pre><code>&lt;Window x:Class="tt.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525"&gt;
  &lt;StackPanel&gt;
      &lt;ItemsControl ItemsSource="{Binding Strings}"/&gt;
      &lt;Button Click="Button_Click"&gt;Add&lt;/Button&gt;
  &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Here is the code behind:</p>
  
  <pre><code> public partial class MainWindow : Window, INotifyPropertyChanged
  {
      public event PropertyChangedEventHandler PropertyChanged;
      public MainWindow()
      {
          InitializeComponent();
          DataContext = this;
          Strings.Add("One");
          Strings.Add("Two");
      }
  
      public List&lt;string&gt; _strings = new List&lt;string&gt;();
      public List&lt;string&gt; Strings
      {
          get { return _strings; }
          set
          {
              if (_strings == value) return;
              _strings = value;
              if (this.PropertyChanged != null)
                  PropertyChanged(this, new PropertyChangedEventArgs("Strings"));
          }
      }
  
      private void Button_Click(object sender, RoutedEventArgs e)
      {
          Strings.Add("More");
          if (this.PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs("Strings"));
      }
  }
  </code></pre>