title: How to wait for form to load, then start method?
body: <p>I have a WPF application that on load executes a method that checks if certain files exist, and if not, downloads them. It also downloads a string to be used as a message, and outputs to an <code>in-app</code> console.</p>
  
  <p>However, when I launch the program I see a white screen for a few seconds, then the window loads and everything is done. So it appears that the method is being executed before the window loads.</p>
  
  <p>How can I wait for the window to load, wait about 2 seconds, then run the method?</p>
  
  <p>This is the code of the method i am trying to run:</p>
  
  <pre><code>consolemessage("STARTUP", "Verifying existence of essential files...");
  if(!File.Exists("Interop.NATUPNPLib.dll"))
      Download("link here", "Interop.NATUPNPLib.dll");
  if(!File.Exists("LICENSE.txt"))
      Download("link here", "LICENSE.txt");
  consolemessage("STARTUP", "Essential file validation completed!");
  </code></pre>