title: What's the difference between the Window.Loaded and Window.ContentRendered events
body: <p>What's the difference between the <code>Window.Loaded</code> and <code>Window.ContentRendered</code> events in WPF?  Is the <code>ContentRendered</code> event called first? </p>
  
  <p>The description of the <code>Window.ContentRendered</code> event <a href="http://msdn.microsoft.com/en-us/library/system.windows.window.contentrendered.aspx">here</a> just says</p>
  
  <blockquote>
    <p>Occurs after a window's content has been rendered.</p>
  </blockquote>
  
  <p>The description of the <code>Window.Loaded</code> event <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.loaded.aspx">here</a> says</p>
  
  <blockquote>
    <p>Occurs when the element is laid out, rendered, and ready for interaction. </p>
  </blockquote>
  
  <p>I have a case where I want to set the window's <code>MaxHeight</code> to the height of the working area of the screen that is displaying my window.  Which event should I do it in?</p>
  
  <p>Edit:</p>
  
  <p>I think I found what I was looking for, but I'm even more confused now.  The <code>Loaded</code> event happens first and then the <code>ContentRendered</code> event happens.  In the book Programming WPF by Chris Sells &amp; Ian Griffiths, it says that the <code>Loaded</code> event is </p>
  
  <blockquote>
    <p>Raised just before the window is shown</p>
  </blockquote>
  
  <p>While the 'ContentRendered` event is </p>
  
  <blockquote>
    <p>Raised when the window's content is visually rendered.</p>
  </blockquote>
  
  <p>This contradicts what the MSDN documentation says about the <code>Loaded</code> event:</p>
  
  <blockquote>
    <p>Occurs when the element is laid out, rendered, and ready for interaction. </p>
  </blockquote>
  
  <p>This is even more confusing now.</p>