title: c#: How to pass linq-objects around
body: <p>When showing my main window, I make a list of objects from linq-to-sql:  </p>
  
  <pre><code> using (var context = new Data.TVShowDataContext())
   {
      Shows = new ObservableCollection&lt;Data.Show&gt;(context.Shows);
      listShows.ItemsSource = Shows;
   }
  </code></pre>
  
  <p>Now, when I doubleclick an item in my list, I want to use the selected object in a new usercontrol:</p>
  
  <pre><code> ShowEpList epList = new ShowEpList();
   epList.DataContext = (Data.Show)listShows.SelectedItem;
  </code></pre>
  
  <p>Now, this results in an exception:</p>
  
  <blockquote>
    <p>System.ObjectDisposedException was unhandled<br>
    Message="Cannot access a disposed object.\r\nObject name: 'DataContext accessed after Dispose.'."<br>
    Source="System.Data.Linq"<br>
    ObjectName="DataContext accessed after Dispose."</p>
  </blockquote>
  
  <p>I guess this comes as a result of binding a list to the shows season-list, and the season-list needs to be populated or something:</p>
  
  <pre><code>&lt;ListBox Name="listSeasons" ItemsSource="{Binding Seasons}"/&gt;
  </code></pre>
  
  <p>Now, what I would like to know, is how this is supposed be done? 
  Would I need to make a new DataContext-object and retrieve the selected show again, or is it possible to re-conntect my show with a new datacontext to populate the seasons-list?</p>
  
  <p>I guess I'm a little lost....</p>