title: Applying MVVM to an ItemsControl populated with UserControls
body: <p>As I knock off more and more MVVM-related issues with my current application, more just keep popping up.  :)</p>
  
  <p>The current implementation that I am trying to replace involves a StackPanel whose children are more or less dynamically generated (via looking in a configuration file).  Each child is an instance of a UserControl.  Before, what I did was assign a name to the StackPanel, and then in the Window_Loaded event handler, I'd simply determine the necessary number of children, instantiate one UserControl for each, and also assign the UserControl an ID so I'd know the proper source for the Buttons clicked on a particular UserControl instance; each UserControl has 3 buttons on it.</p>
  
  <p>So I know I want to bind the StackPanel to a collection.  This of course, is not possible, as I need to use something that derives from ItemsControl, like ListBox or ListView (or even ItemsControl itself).  To keep it easy in the first iteration of MVVM-ifying, I'll just use a ListBox.</p>
  
  <p>Now the question is, should my ObservableCollection in the code-behind be a ObservableCollection?  I believe this means that no matter how I skin my GUI, this ListBox will always have children that look however they do in MyUserControl's XAML file.  I'd like this to be customizable as well, but I assume this means I have to apply the MVVM pattern to the UserControl as well.</p>