title: ItemsControl button click command
body: <p>I need some quick help which is a road blocker for me now. I have <code>Button</code> in <code>ItemsControl</code> and I need to perform some task on Button click. I tried adding <code>Command</code> to <code>Button</code> in I<code>temsControl</code> <code>DataTemplate</code> but its not working. Can anyone suggest how to proceed further.</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;DataTemplate x:key="mytask"&gt;
          &lt;TextBox Grid.Row="5" Grid.Column="2" Text="{Binding Path=PriorNote}" Grid.ColumnSpan="7"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5" Width="505" Foreground="Black"/&gt;
          &lt;StatusBarItem Grid.Row="2" Grid.Column="8" Margin="8,7,7,8" Grid.RowSpan="2"&gt;
          &lt;Button x:Name="DetailsButton" Command="{Binding CommandDetailsButtonClick}"&gt;
      &lt;/DataTemplate&gt;
  &lt;/UserControl.Resources&gt;
  
  &lt;Grid&gt;
      &lt;ItemsControl Grid.Row="1" 
                    ItemsSource="{Binding ListStpRules}" 
                    ItemTemplate="{StaticResource myTaskTemplate}" Background="Black"
                    AlternationCount="2" &gt;
      &lt;/ItemsControl&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>and in ViewModel I have implemented code for Command. And its not working. Please suggest any solution for me to proceed further</p>