title: adding button to datatemplate and calling its click event
body: <p>I am trying to build a WPF application (using C#.net) in which I want to add button inside ListBox.</p>
  
  <p>Here is the data template which I have placed in the resource dictionary</p>
  
  <pre><code>&lt;DataTemplate x:Key="MYTemplate"&gt;
      &lt;StackPanel Margin="4"&gt;
          &lt;DockPanel&gt;
              &lt;TextBlock Text="ISBN No:" DockPanel.Dock="Left" Margin="5,0,10,0" Foreground="AliceBlue" /&gt;
              &lt;TextBlock Text="            " /&gt;
              &lt;TextBlock Text="{Binding ISBN}" Foreground="LimeGreen" FontWeight="Bold" /&gt;
          &lt;/DockPanel&gt;
          &lt;DockPanel&gt;
              &lt;TextBlock Text="Book Name:" DockPanel.Dock="Left" Margin="5,0,10,0" Foreground="AliceBlue"/&gt;
              &lt;TextBlock Text="       " /&gt;
              &lt;TextBlock Text="{Binding BookName}" Foreground="LimeGreen"  FontWeight="Bold" /&gt;
          &lt;/DockPanel &gt;
          &lt;DockPanel &gt;
              &lt;TextBlock Text="Publisher Name:" DockPanel.Dock="Left" Margin="5,0,10,0" Foreground="AliceBlue" /&gt;
              &lt;TextBlock Text=" " /&gt;
              &lt;TextBlock Text="{Binding PublisherName}" Foreground="LimeGreen" FontWeight="Bold"  /&gt;
          &lt;/DockPanel&gt;
          &lt;DockPanel&gt;
              &lt;Button Name="MyButton" Content="Click Me"&gt;
  
              &lt;/Button&gt;
          &lt;/DockPanel&gt;
      &lt;/StackPanel&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>How do add the click event to the button tag in the above template?
  Also where should I place the method which will be called when button is clicked.</p>