title: How to use EventTrigger and InvokeCommandAction programmatically?
body: <p>I have a popup with a <code>TextBox</code> that the user should enter a ticket number into, and then when the user presses the enter key I want the ticket number to be passed to the ViewModel which will retrieve the ticket.</p>
  
  <p>Here's the xaml for the <code>TextBox</code>:</p>
  
  <pre><code>&lt;TextBox x:Name="TicketNumber"&gt;
      &lt;i:Interaction.Triggers&gt;
          &lt;i:EventTrigger EventName="KeyDown"&gt;
              &lt;i:InvokeCommandAction Command="{Binding OpenTicketCommand}" 
                                     CommandParameter="{Binding ElementName=TicketNumber,
                                                                Path=Text}"/&gt;
          &lt;/i:EventTrigger&gt;
      &lt;/i:Interaction.Triggers&gt;
  &lt;/TextBox&gt;
  </code></pre>
  
  <p>The above works on any keypress, but I really only want it to happen when the enter key is pressed.  How would I go about doing that?</p>
  
  <p><strong>EDIT:</strong> I am assuming it would have to be done programmatically (hence the title), but if not that's okay too.</p>