title: MVVM - Communication between Separated Views
body: <p>I'm trying to figure out how to do the following:</p>
  
  <p>I have a <code>CustomerListViewModel</code> that contains a <code>ObservableCollection&lt;Customer&gt;</code></p>
  
  <p><code>MainView</code> holds an instance of these views:</p>
  
  <ul>
  <li><code>CustomerListView</code> - which creates an instance of <code>CustomerListViewModel</code></li>
  <li><code>SearchView</code> - which creates and instance of <code>SearchViewModel</code></li>
  </ul>
  
  <p>My question is, How do I keep the CustomerListView and the SearchView separated.
  The SearchView should only be displayed if a Customer is selected. The only dependency for the SearchViewModel should be a <code>Customer</code> Model. If there isn't a Customer selected from the CustomerListViewModel, then the SearchView shouldn't be displayed.</p>
  
  <p>Should I introduce a new View/ViewModel that contains both a <code>CustomerListViewModel</code> and <code>SearchViewModel</code> that can hold a reference to the Selected <code>Customer</code> and toggle the displaying of a SearchView? If not, how should I go about this?</p>
  
  <p>I know this question is pretty broad, but I would appreciate any suggestions.</p>