title: Line not being Drawn in WPF DataTemplate
body: <p>I am trying to gather correct WPF Datatemplates to Have a Listview That For Each Item has a Border+Canvas (See  ) and then Draws a Line on that Canvas for each Item in the final Node Collection.  It almost works but currently I have no lines being Drawn on the canvas: In the Debug Output Window I am seeing:</p>
  
  <blockquote>
    <p>System.Windows.Data Error: 40 : BindingExpression path error: 'CalloutGroup' property not found on 'object' ''CalloutGroup' (HashCode=35061213)'. BindingExpression:Path=CalloutGroup; DataItem='CalloutGroup' (HashCode=35061213); target element is 'ItemsControl' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')</p>
  </blockquote>
  
  <p>Here is MainWindow.Xaml</p>
  
  <pre><code>&lt;Window
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:CalloutControl" x:Class="CalloutControl.MainWindow"
          Title="MainWindow" Height="430.597" Width="525"&gt;
      &lt;Window.Resources&gt;
          &lt;DataTemplate x:Key="LineTemplate"&gt;
              &lt;Line X1 ="{Binding X}" X2="{Binding X}" Stroke="Wheat" 
                        StrokeThickness="10" Y1="{Binding Y}" Y2="{Binding Y}"/&gt;
          &lt;/DataTemplate&gt;
  
  
          &lt;DataTemplate x:Key="GroupTemplate"&gt;
          &lt;Border Width="200" Height ="{Binding DistributionHeight}" BorderThickness="5" Background="Brown" BorderBrush="Red"&gt;
                  &lt;ItemsControl ItemsSource="{Binding Path=CalloutGroup}" 
                            ItemTemplate="{StaticResource LineTemplate}"&gt;
                      &lt;ItemsControl.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;Canvas Background="Beige"/&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ItemsControl.ItemsPanel&gt;
              &lt;/ItemsControl&gt;
          &lt;/Border&gt;
          &lt;/DataTemplate&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;Border&gt;
          &lt;ListView ItemsSource="{Binding Groups}"
                        ItemTemplate="{StaticResource GroupTemplate}"&gt;
  
          &lt;/ListView&gt;
          &lt;/Border&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>MainWindow.xaml.cs</p>
  
  <pre><code> using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Navigation;
  using System.Windows.Shapes;
  
  namespace CalloutControl
  {
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
              var vm = new MainWindowViewModel();
              DataContext = vm;
          }
      }
  }
  </code></pre>
  
  <p>Then the ViewModel -> MainWindowViewModel.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Collections.ObjectModel;
  
  namespace CalloutControl
  {
      public class CalloutItem            : INotifyPropertyChanged
      {
          public CalloutItem()
          {
  
          }
          public CalloutItem (int length,
                     int itemNum,
                       double x,
                      double y ){
                          Length = length;
                          ItemNum = itemNum;
                          X = x;
                          Y =  y;
          }
          private int length;
  
          public int Length
          {
              get { return length; }
              set
              {
                  length = value;
                  OnPropertyChanged("Length");
              }
          }
          private int itemNum;
  
          public int ItemNum
          {
              get { return itemNum; }
              set { itemNum = value;
              OnPropertyChanged("ItemNum");
              }
          }
          //public int      ItemNum;
          private double x;
  
          public double X
          {
              get { return x; }
              set { x = value;
                    OnPropertyChanged("X");
              }
          }
          private double y;
  
          public double Y
          {
              get { return y; }
              set { y = value;
              OnPropertyChanged("Y");
              }
          }
  
          public event PropertyChangedEventHandler PropertyChanged;
          protected void OnPropertyChanged(string name)
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(name));
              }
          }
      }
      public class CalloutGroup           : INotifyPropertyChanged
      {
          ObservableCollection&lt;CalloutItem&gt; group = new ObservableCollection&lt;CalloutItem&gt;();
          public CalloutGroup(int nItems)
          {
              NumItems = nItems;
  
          }
          public ObservableCollection&lt;CalloutItem&gt; Group
          {
              get { return group; }
              set
              {
                  group = value;
                  OnPropertyChanged("Group");
              }
          }
          private double distributionHeight = 400;
  
          public double DistributionHeight
          {
              get { return distributionHeight; }
              set
              {
                  distributionHeight = value;
                  Redistribute();
                  OnPropertyChanged("DistributionHeight");
              }
          }
  
  
          private void Redistribute()
          {
              double step = distributionHeight / numItems;
              double currY = step / 2 ;
              var redistArr = group.ToArray();
  
              for (int i = 0; i &lt; group.Count(); i++)
              {
                  redistArr[i].Y = currY;
                  currY += step;
              }
              OnPropertyChanged("Group");
          }
          private int numItems = 10;
  
          public int NumItems
          {
              get { return numItems; }
              set
              {
                  numItems = value;
                  group.Clear();
                  for (int i = 0; i &lt; numItems; i++)
                  {
                      group.Add(new CalloutItem());
                  }
                  Redistribute();
                  OnPropertyChanged("NumItems");
              }
          }
          public event PropertyChangedEventHandler PropertyChanged;
          protected void OnPropertyChanged(string name)
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(name));
              }
          }
      }
  
      public class MainWindowViewModel    : INotifyPropertyChanged
      {
  
          ObservableCollection&lt;CalloutGroup&gt; groups = new ObservableCollection&lt;CalloutGroup&gt;();
  
          public ObservableCollection&lt;CalloutGroup&gt; Groups
          {
              get { return groups; }
              set { groups = value;
                    OnPropertyChanged("Groups");
              }
          }
          public MainWindowViewModel ()
          {
              groups.Add(new CalloutGroup(3));
              groups.Add(new CalloutGroup(3));
  
          }
  
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          protected void OnPropertyChanged(string name)
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(name));
              }
          }
      }
  }
  </code></pre>