title: WPF, ObservableCollection/BindingList binding to ListView
body: <p>I have problem binding ObservableCollection to LisView.
  The problem is that Binding works fine only when I add/remove item from ObservableCollection.
  But when I change property of one item in ObservableCollection the ListView still shows old value.
  I know it's a common problem and searched for a solution and everybody say that I should use BindingList instead of ObservableCollectione because ObservableCollection does not propagate PropertyChanged events and BindingList does. So I changed to Binding List but the problem remains the same.</p>
  
  <p>Class:</p>
  
  <pre><code>public class Network
  {
      public class Layer : INotifyPropertyChanged
      {
          public enum ActivFunction { LINEAR, EXPONENTIAL, ARCUSTANGENT }
  
          private string name;
  
          public string Name
          {
              get
              {
                  return name;
              }
              set 
              {
                  name = value;
                  RaisePropertyChanged("Name"); 
              }
          }
  
          public ActivFunction Activation { get; set; }
          public int Neurons { get; set; }
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          protected virtual void RaisePropertyChanged(String propertyName)
          {
              if ((PropertyChanged != null))
              {
                  PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
              }
          }
  
      }
  
      public BindingList&lt;Layer&gt; Layers { get; set; }
  
      public Network()
      {
          Layers = new BindingList&lt;Layer&gt;();
      }
  
      public void AddLayer(Layer layer)
      {
          if (Layers.Count &gt; 0)
          {
              int last = Layers.Count;
              Layers.Last().Name = "Layer " + last + " (hidden)";
          }
          Layers.Add(layer);
      }
  
      public void RemoveLayer(int index)
      {
          if( index &gt;= 0 &amp;&amp; index &lt; Layers.Count )
              Layers.RemoveAt(index);
      }
  }
  </code></pre>
  
  <p>Binding:</p>
  
  <pre><code>&lt;ListView Grid.Row="0" x:Name="NetworkListview" ItemsSource="{Binding network.Layers}"
            IsSynchronizedWithCurrentItem="True"&gt;
      &lt;ListView.View&gt;
          &lt;GridView&gt;
              &lt;GridViewColumn Width="100" Header="layer name"
                              DisplayMemberBinding="{Binding Name}"/&gt;
              &lt;GridViewColumn Width="60" Header="neurons"
                              CellTemplate="{StaticResource NeuronsTemplate}"/&gt;
              &lt;GridViewColumn Width="110" Header="activation"
                              CellTemplate="{StaticResource ActivationTemplate}"/&gt;
          &lt;/GridView&gt;
      &lt;/ListView.View&gt;
  &lt;/ListView&gt;
  </code></pre>