title: WPF: Loading data in the constructor of a UserControl breaks the Designer
body: <p>I have a main window with a usercontrol. When adding code in the default constructor of the usercontrol, the designer stops showing the main window. It gives a message:</p>
  
  <blockquote>
    <p>Problem loading  </p>
    
    <p>The document contains errors that must be fixed before the designer can be loaded.<br>
    Reload the designer after you have fixed the errors.</p>
    
    <p>Reload the designer</p>
  </blockquote>
  
  <p>Why is this?</p>
  
  <p>This is the code that I have in the constructor:</p>
  
  <pre><code>using (var context = new Data.TVShowDataContext())
  {
      var list = from show in context.Shows
                 select show;
  
      listShow.ItemsSource = list;
  }
  </code></pre>
  
  <p>If I can't use the constructor to fill gui with data, when should I else do it? Would it be better to do this with binding? Any sugestions how?</p>