title: How to Bind SubTotal in ItemsControl Group
body: <p>Picture this DTO-like class:</p>
  
  <pre><code>class LineItem : INotifyPropertyChanged
  {
      public event PropertyChangedEventHandler PropertyChanged;
      public string Description { get; set; }
  
      private decimal m_Amount;
      public decimal Amount
      {
          get { return m_Amount; }
          set
          {
              if (m_Amount == value)
                  return;
              m_Amount = value;
              if (PropertyChanged != null)
                  PropertyChanged(this, new PropertyChangedEventArgs("Amount"));
          }
      }
  }
  </code></pre>
  
  <p>And a binding like this:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding LineItems}"&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;DockPanel&gt;
                  &lt;TextBox Text="{Binding Amount}"
                          DockPanel.Dock="Right" Width="50" /&gt;
                  &lt;TextBlock Text="{Binding Description}" /&gt;
              &lt;/DockPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>This would look something like:</p>
  
  <p><img src="https://i.stack.imgur.com/E7hAY.png" alt="enter image description here"></p>
  
  <p>Now, I want a total at the bottom. Moreover, I want it to update when Amount changes. </p>
  
  <p>Something like this:</p>
  
  <pre><code>&lt;TextBlock HorizontalAlignment="Right"
              Text="{Binding LineItems, 
              Converter={StaticResource MyConverter}}" /&gt;
  </code></pre>
  
  <p>For this:</p>
  
  <p><img src="https://i.stack.imgur.com/nRWxN.png" alt="enter image description here"></p>
  
  <p>But what is MyConverter? And, is it even a correct approach?</p>
  
  <p>My question:</p>
  
  <p>This does not work since the converter is called only the first time it is bound. I want it to reflect user changes, and I need to handle unknown quantity of LineItems. Certainly I am not the first to hit this. <strong>Is there a way?</strong></p>