title: WPF List of ViewModels bound to list of Model objects
body: <p>In the model, I have:</p>
  
  <pre><code>public ObservableCollection&lt;Item&gt; Items { get; private set; }
  </code></pre>
  
  <p>In the ViewModel, I have a corresponding list of ItemViewModels.  I would like this list to be two-way bound to the model's list:</p>
  
  <pre><code>public ObservableCollection&lt;ItemViewModel&gt; ItemViewModels ...
  </code></pre>
  
  <p>In the XAML, I will bind (in this case a TreeView) to the ItemViewModels property.</p>
  
  <p>My question is, what goes in the "..." in the ViewModel shown above?  I am hoping for a line or two of code to binds these two ObservableCollections (providing the type of the ViewModel to construct for each model object).  However, what I'm fearing is necessary is a bunch of code to handle the Items.CollectionChanged event and manually updates the ItemViewModels list by constructing ViewModels as necessary, and the corresponding opposite that will update the Items collection based on changes to ItemViewModels.</p>
  
  <p>Thanks!</p>
  
  <p>Eric</p>