title: WPF Command binding in DataTemplate
body: <p>I'm using <code>ItemsControl</code> to hold my collection.
  The <code>ItemsPanel</code> is a <code>Canvas</code>, the <code>ItemTemplate</code> is a block of <code>Border</code>><code>StackPanel</code>><code>TextBlocks</code>
  I want to bind a command in the <code>DataTemplate</code> to catch the click on a block (item of my collection)</p>
  
  <p>Code:</p>
  
  <pre><code>   &lt;Grid Grid.Row="1" Grid.Column="1" &gt;
          &lt;ItemsControl ItemsSource="{Binding Products}"&gt;
              &lt;ItemsControl.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;helpers:DragCanvas 
                          HorizontalAlignment="Stretch" 
                          VerticalAlignment="Stretch"
                          AllowDragging="True"
                          AllowDragOutOfView="False" /&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/ItemsControl.ItemsPanel&gt;
              &lt;ItemsControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;!-- The border and its content is what I see
                      on my canvas, I want to bind a command here (on click do something) --&gt;
                      &lt;Border BorderThickness="1" BorderBrush="Gold"&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;
                              &lt;TextBlock Text="{Binding Path=Name}" /&gt;
                              &lt;TextBlock Text="{Binding Path=Price}" /&gt;
                          &lt;/StackPanel&gt;
                      &lt;/Border&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ItemsControl.ItemTemplate&gt;    
          &lt;/ItemsControl&gt;
      &lt;/Grid&gt;
  </code></pre>