title: Fire button event manually
body: <p>I have a search text box on my WPF Windows. Whenever, the user presses enter key after writing some query in the textBox, the process should start.</p>
  
  <p>Now, I also have this Search button, in the event of which I perform all this process.</p>
  
  <p>So, for a texBox:</p>
  
  <pre><code>&lt;TextBox x:Name="textBox1" Text="Query here" FontSize="20" Padding="5" Width="580" KeyDown="textBox1_KeyDown"&gt;&lt;/TextBox&gt;
  
  private void queryText_KeyDown(object sender, KeyEventArgs e)
          {
              if (e.Key == Key.Return)
              {
                  //how do I fire the button event from here?
              }
          }
  </code></pre>