title: Refresh DataContext for Views in WPF?
body: <p>I am working with a WPF application and using my own architecture that strongly resembles a M-V-VM /MVC. I have controllers for each of the views, and I have ViewModels that are bound to the Views.</p>
  
  <p>For Example, I have a ToolBarView that has a corresponding ToolBarViewModel, and ToolBar Controller.</p>
  
  <p>I am using notifications to update all the views so that they do not need to reference each other, but that is not relevant for my question.</p>
  
  <p>Each of the Views is listening for an event to trigger in their controller when the model has been updated. In the ToolBarView this looks like the following.</p>
  
  <pre><code>/*In Constructor in ToolbarView*/
  Controller.Updated += UpdateView
  
  /*Event Handler in ToolbarView*/
  private void Updateview(object sender,EventArgs e)
  {
      DataContext = Controller.Model;
  
      //Other Updating if needed
  
   }
  </code></pre>
  
  <p>If not obvious, what the above code is doing is saying that when the  Controller fires the Updated event, to invoke the UpdateView(object sender,EventArgs e).</p>
  
  <p>The problem that I am experiencing is that the first time that the UpdateView() is invoked, everything is working fine, but when it is invoked the second time, the DataContext seems to still be bound to the original Controller.Model.</p>
  
  <p>It seems almost as if I have to release the DataContext, or refresh it in order for it to be bound to the Model every time.</p>
  
  <p>The Controller is performing operations on the Model, and therefor when the UpdateView() is invoked, it needs to display the newly assigned values on that model.</p>
  
  <p>Is there some way I need to refresh the DataContext, or is there a different way I need to do this?</p>