title: ListView not Updating on a PropertyChanged Event
body: <p>I have the following code, but the problem is that PropertyChanged is always null when I try to fire it. Why is that, and how could I get around this?</p>
  
  <p>Creating the ListView programmatically and adding a binding to it:</p>
  
  <pre><code>            ListView listView = new ListView();
              listView.Height = 203;
              listView.Width = 501;
              listView.Margin = new Thickness(0, 0, 0, 0);
              Grid.SetRow(listView, 1);
              Grid.SetColumn(listView, 0);
              mainGrid.Children.Add(listView);
              GridView myGridView = new GridView();
              myGridView.AllowsColumnReorder = true;
              System.Windows.Controls.GridViewColumn gvc1 = new System.Windows.Controls.GridViewColumn();
              gvc1.DisplayMemberBinding = new Binding("Date");
              gvc1.Header = "Date";
              gvc1.Width = 100;
              myGridView.Columns.Add(gvc1);
              System.Windows.Controls.GridViewColumn gvc2 = new System.Windows.Controls.GridViewColumn();
              gvc2.DisplayMemberBinding = new Binding("Application");
              gvc2.Header = "Application";
              gvc2.Width = 100;
              myGridView.Columns.Add(gvc2);
              System.Windows.Controls.GridViewColumn gvc3 = new System.Windows.Controls.GridViewColumn();
              gvc3.DisplayMemberBinding = new Binding("Message");
              gvc3.Header = "Message";
              gvc3.Width = 100;
              myGridView.Columns.Add(gvc3);
              listView.View = myGridView;
              // Create a new binding object and set the binding of this list view to it.
              //rows = new ObservableCollection&lt;Row&gt;();
              rows = new Rows();
              // Create a background worker to update the rows every second.
              BackgroundWorker bgworker = new BackgroundWorker();
              bgworker.WorkerReportsProgress = true;
              bgworker.DoWork += (doWorkSender, doWorkEventArguments) =&gt; {
                  for (int i = 0; i &lt; 1000000; i++) {
                      Thread.Sleep(1000);
                      bgworker.ReportProgress(i);
                  }
                  doWorkEventArguments.Result = null;
              };
              bgworker.ProgressChanged += (progressChangedSender, progressChangedEventArguments) =&gt; {
                  rows.Add(new Row { Date = DateTime.Now.ToString(), Application = "Application", Message = "This is a sample message." });
              };
              bgworker.RunWorkerAsync();
              listView.DataContext = rows;
              Binding myBinding = new Binding();
              myBinding.Source = rows;
              listView.SetBinding(ItemsControl.ItemsSourceProperty, myBinding);
  </code></pre>
  
  <p>The Row and Rows classes:</p>
  
  <pre><code>    public class Row {
          public string Date { set; get; }
          public string Application { set; get; }
          public string Message { set; get; }
      }
  
      public class Rows : IEnumerable&lt;Row&gt;, INotifyPropertyChanged {
          public List&lt;Row&gt; rowList { get; private set; }
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          public Rows() {
              rowList = new List&lt;Row&gt;();
          }
  
          public void Add(Row item) {
              rowList.Add(item);
              if (PropertyChanged != null) {
                  PropertyChanged(this, new PropertyChangedEventArgs("rowList"));
              }
              else {
                  Console.WriteLine("PropertyChanged is null.");
              }
          }
  
          public IEnumerator&lt;Row&gt; GetEnumerator() {
              return rowList.GetEnumerator();
          }
  
          System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
              return GetEnumerator();
          }
  
      }
  </code></pre>
  
  <p>The rows object is declared as a Rows type:</p>
  
  <pre><code>Rows rows;
  </code></pre>