title: Why to run code in method called by XAML Window.Loaded?
body: <p>I saw a code example that creates a method <code>Window_Loaded()</code> which is called by XAML's "Window Loaded" event:</p>
  
  <pre><code>&lt;Window x:Class="TestModuleLoader.Window1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Window1" Height="300" Width="300" Loaded="Window_Loaded"&gt;
      &lt;Grid&gt;
          ...
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>But in the code behind, the code worked in both the constructor and the <code>Window_Loaded()</code> method:</p>
  
  <pre><code>using System.Windows;
  
  namespace TestModuleLoader
  {
      public partial class Window1 : Window
      {
          public Window1()
          {
              InitializeComponent();
          }
  
          private void Window_Loaded(object sender, RoutedEventArgs e)
          {
              //what advantages do I have running code here? 
          }
      }
  }
  </code></pre>
  
  <p>Are there any advantages to doing this?  </p>
  
  <p>Is there a "Window Load Cycle" as in ASP.NET going on here that is helpful to know about, i.e. methods such as <code>PreRender()</code>, <code>PostRender()</code>, etc?</p>