title: Implementing the double-click event on Silverlight 4 Datagrid
body: <p>Any good soul have an example of implementing the "Command Pattern" introduced by Prism on a double click event in a Silverlight 4.0 DataGrid?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>&lt;data:DataGrid x:Name="dgUserRoles" AutoGenerateColumns="False" Margin="0" Grid.Row="0" ItemsSource="{Binding Path=SelectedUser.UserRoles}" IsReadOnly="False"&gt;
      &lt;data:DataGrid.Columns&gt;
          &lt;data:DataGridTemplateColumn Header=""&gt;
              &lt;data:DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Button Width="20" Height="20" Click="Button_Click" Command="{Binding EditRoleClickedCommand}" CommandParameter="{Binding SelectedRole}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/data:DataGridTemplateColumn.CellTemplate&gt;
          &lt;/data:DataGridTemplateColumn&gt;
          &lt;data:DataGridTextColumn Header="Role Name" Binding="{Binding RoleName}" /&gt;
          &lt;data:DataGridTextColumn Header="Role Code" Binding="{Binding UserroleCode}" IsReadOnly="True"/&gt;
          &lt;data:DataGridCheckBoxColumn Header="UDFM Managed" Binding="{Binding RoleIsManaged}" IsReadOnly="True" /&gt;
          &lt;data:DataGridCheckBoxColumn Header="UDFM Role Assigned" Binding="{Binding UserroleIsUdfmRoleAssignment}" IsReadOnly="True" /&gt;
          &lt;data:DataGridTextColumn Header="Source User" Binding="{Binding SourceUser}" IsReadOnly="True" /&gt;
      &lt;/data:DataGrid.Columns&gt;
  &lt;/data:DataGrid&gt;
  </code></pre>
  
  <p>As you see I did try to hook up the Command there and it is not firing the event in my View Model.</p>
  
  <p>Looking for a good alternative.</p>