title: How to bind class that inherit from collection wpf
body: <p>i'm pretty new in wpf and i'm having troubles with a simple <code>ListBox</code> binding.</p>
  
  <p>This is the case, i have two clases</p>
  
  <pre><code>public class Child, ImplementedPropertyChanged
  {
      private string _name;
      public string Name 
      { 
          get =&gt; _name;
          set
          {
              _name = value;
              OnPropertyChanged();
          }
      }
  }
  
  public class ChildCollection : IObservableCollection&lt;Child&gt;
  {
      new public void Add(Child child)
      {
          //some logic
          base.Add(child);
      }
  }
  </code></pre>
  
  <p>And i'm trying to bind it in xaml</p>
  
  <pre><code>&lt;Window x:Class="GeneradorDeCarpetaPlanos.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:GeneradorDeCarpetaPlanos"
          xmlns:VM="clr-namespace:GeneradorDeCarpetaPlanos.ViewModel"
          mc:Ignorable="d"
          Title="MainWindow" Height="450" Width="800"&gt;
          &lt;Window.DataContext&gt;
              &lt;VM:ChildCollection&gt;&lt;/VM:ChildCollection&gt;
          &lt;/Window.DataContext&gt;
  
      &lt;StackPanel&gt;
  
          &lt;ListBox ItemsSource="{Binding}"&gt;
              &lt;ListBoxItem&gt;
                  &lt;TextBlock Text="{Binding Path=Name}"&gt;&lt;/TextBlock&gt;
              &lt;/ListBoxItem&gt;
          &lt;/ListBox&gt;       
  
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>And in the code behind </p>
  
  <pre><code>ChildCollection childs = null;
      public MainWindow()
      {
          childs = new ChildCollection();            
          InitializeComponent();
          DataContext = childs;
      }
  </code></pre>
  
  <p>I try to bind the <code>Count</code> property to a simple <code>TextBlock</code> and that is showing the <code>Count</code> but not updating with <code>ChildCollection</code> object</p>
  
  <p>How shoud i bind it?</p>
  
  <p>Thanks!</p>