title: Binding Command inside DataGridTemplateColumn
body: <p>I have View(XAML included) attached to my ViewModel with commands. I need to invoke command when Button on DataGrid's row clicked. I'm using behaviors for this (regular commanding have same issue). When I click button on DataGrid - my command does not get fired.</p>
  
  <p>To illustrate issue - I placed ListBox on a bottom with EXACT same binding stuff - and yes, command works. So, it's something with DataGrid/DataGridTemplateColumn</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding}"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="30" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="*" /&gt;
              &lt;/Grid.RowDefinitions&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;Button Content="Cancel" &gt;
                      &lt;i:Interaction.Triggers&gt;
                          &lt;i:EventTrigger EventName="Click"&gt;
                              &lt;ei:CallMethodAction MethodName="Cancel" TargetObject="{Binding}"/&gt;
                          &lt;/i:EventTrigger&gt;
                      &lt;/i:Interaction.Triggers&gt;
                  &lt;/Button&gt;
              &lt;/StackPanel&gt;
              &lt;sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Data}" Grid.Row="1"&gt;
                  &lt;sdk:DataGrid.Columns&gt;
                      &lt;sdk:DataGridTemplateColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto"&gt;
                          &lt;sdk:DataGridTemplateColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;Button Content="Select"&gt;
                                      &lt;i:Interaction.Triggers&gt;
                                          &lt;i:EventTrigger EventName="Click"&gt;
                                              &lt;i:InvokeCommandAction Command="{Binding ElementName=Control, Path=DataContext.ItemSelectedCommand}" CommandParameter="{Binding}" /&gt;
                                          &lt;/i:EventTrigger&gt;
                                      &lt;/i:Interaction.Triggers&gt;
                                  &lt;/Button&gt;  
                              &lt;/DataTemplate&gt;
                          &lt;/sdk:DataGridTemplateColumn.CellTemplate&gt;
                      &lt;/sdk:DataGridTemplateColumn&gt;
                      &lt;sdk:DataGridTextColumn Binding="{Binding DeviceId}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Device" Width="Auto" FontWeight="Bold" /&gt;
                      &lt;sdk:DataGridTextColumn Binding="{Binding SerialNumber}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Serial Number" Width="Auto" /&gt;
                      &lt;sdk:DataGridTextColumn Binding="{Binding LastActivityOn}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Last Activity" Width="Auto" /&gt;
                      &lt;sdk:DataGridTextColumn Binding="{Binding ClientVersion}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Client Version" Width="Auto" /&gt;
                      &lt;sdk:DataGridTextColumn Binding="{Binding OSVersion}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="OS Version" Width="Auto" /&gt;
                  &lt;/sdk:DataGrid.Columns&gt;
  
              &lt;/sdk:DataGrid&gt;
              &lt;ListBox Grid.Row="2" ItemsSource="{Binding Data}"&gt;
                  &lt;ListBox.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;
                              &lt;TextBlock Text="{Binding DeviceId}"&gt;&lt;/TextBlock&gt;
                              &lt;Button Content="Select"&gt;
                                  &lt;i:Interaction.Triggers&gt;
                                      &lt;i:EventTrigger EventName="Click"&gt;
                                          &lt;i:InvokeCommandAction Command="{Binding ElementName=Control, Path=DataContext.ItemSelectedCommand}" CommandParameter="{Binding}" /&gt;
                                      &lt;/i:EventTrigger&gt;
                                  &lt;/i:Interaction.Triggers&gt;
                              &lt;/Button&gt;
                          &lt;/StackPanel&gt;                        
                      &lt;/DataTemplate&gt;
                  &lt;/ListBox.ItemTemplate&gt;
              &lt;/ListBox&gt;
          &lt;/Grid&gt;
  </code></pre>