title: How to bind a command to Window Loaded event using WPF and MVVM
body: <p>There is a button which is binded to a command like this on my WPF window : </p>
  
  <pre><code>&lt;Button Command="{Binding SearchCommand}"&gt;
  </code></pre>
  
  <p>I want that Command to be executed when that window is loaded.
  I added this to xaml : </p>
  
  <pre><code>Loaded="DXWindow_Loaded"&gt;
  </code></pre>
  
  <p>And I added this to code-behind, but I don't know what to write to fill the method.</p>
  
  <pre><code>private void DXWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
  {
  
  }
  </code></pre>
  
  <p>How can I call that SearchCommand or SearchExecute from code-behind? Thanks.</p>