title: How do I capture the key pressed in XAML when using interactivity EventName=PreviewKeyDown in a DataGrid?
body: <p>I have a DataGrid that has many rows in it.  I want to capture the keyboard key or keys pressed and execute the appropriate code depending on key pressed.  I want the user to be able to do CTRL-D to delete a row or press the DELETE key.  I also need to pass the DataGrid element as a parameter to the code called.  Here is what I am doing in my XAML.</p>
  
  <pre><code>&lt;i:EventTrigger EventName="PreviewKeyDown"&gt;
      &lt;i:InvokeCommandAction Command="{Binding DataContext.TargetFieldsKeyDownCommand, 
          RelativeSource={RelativeSource AncestorType={x:Type vw:MappingDataView}}}" &gt;
          &lt;i:InvokeCommandAction.CommandParameter&gt;
               &lt;MultiBinding Converter="{StaticResource KeyPressConverter}"&gt;
                    &lt;Binding Source="Delete" /&gt;
                    &lt;Binding ElementName="dtTDGrid" /&gt;
               &lt;/MultiBinding&gt;
          &lt;/i:InvokeCommandAction.CommandParameter&gt;
      &lt;/i:InvokeCommandAction&gt;
  &lt;/i:EventTrigger&gt;
  </code></pre>
  
  <p>I want to replace this, <code>&lt;Binding Source="Delete" /&gt;</code>, with the actual key pressed.  Is there away to do this using Interactivity in XAML or do I need to handle the key pressed differently?  Does anyone of any examples of what I am trying to do?</p>
  
  <p>Using the MultiBinding of Interactivity is all I have found for passing 2 or more command parameters to the Event called.  If there is a better way to call the Event Handler while passing multiple parameters please let me know.</p>