title: WPF: Raise an Event when Item is added in ListView
body: <p>I am working on WPF and I am using a ListView, and I need to fire an event when an item is added to it. I have tried this:</p>
  
  <pre><code>var dependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(ListView));
          if (dependencyPropertyDescriptor != null)
          {
                 dependencyPropertyDescriptor.AddValueChanged(this, ItemsSourcePropertyChangedCallback);
          }
  </code></pre>
  
  <p>.....</p>
  
  <pre><code> private void ItemsSourcePropertyChangedCallback(object sender, EventArgs e)
      {
           RaiseItemsSourcePropertyChangedEvent();
      }
  </code></pre>
  
  <p>But It seems to be working only when the entire collection is changed, I have read this post: <a href="https://stackoverflow.com/questions/5904519/event-fired-when-item-is-added-to-listview">event-fired-when-item-is-added-to-listview</a>, but the best answer applies for a listBox only. I tried to change the code to ListView but I wasnt able to do that.</p>
  
  <p>I hope You can help me. Thank you in advance.</p>