title: WPF MVVM Communication Between Two User Controls
body: <p>I am working on a WPF application that consists of a lot of data entry forms. I have exposed each of these forms as a separate user control. So, I have CustomerView (UserControl), CompaniesView (UserControl). Each form consist of fields like Customer Name, Company Name that user enters and then saves them. </p>
  
  <p>The save action is performed using a Toolbar which consists of "Save", "Delete" and "Close" options. I have created Toolbar into a separate UserControl and put that in the container view/ shell view. Here is the structure of things that will make it clear.</p>
  
  <pre><code>CONTAINER BEGINS
  --------------------------------------------------------------------
  
  -----------------------------------
  THIS IS THE TOOLBAR
  ----------------------------------
  ______________________________________
  
  
  Data Entry forms are injected here on the fly
  
  
  ______________________________________
  
  
  ---------------------------------------------------------------------
  CONTAINER ENDS
  </code></pre>
  
  <p>The problem is that when I click the Save button in the Toolbar I have no idea of knowing anything about the view which contains the form. I need to get hold of the MVVM model attached to that view so I can save it. </p>