title: Pattern for sharing data between views (MVP or MVVM)
body: <p>What is a good pattern for sharing data between related views?. </p>
  
  <p>I have an application where 1 form contains many small views, each views behaves independently from each other more or less (they communicate/interact via an event bus). Every so often I need to pass the same objects to the child views. Sometimes I need this same object to be passed to a child view and then the child passes it onto another child itself contains. </p>
  
  <p>What is a good approach to sharing this data between all the views contained within the parent form (view) ?</p>
  
  <p>I have looked into CAB and their approach and every "view" has a "root work item" this work item has dictionary that contains a shared "state" between the views that are contained. </p>
  
  <p>Is this the best approach? just a shared dictionary all the views under a root view can access? </p>
  
  <p>My current approach right now is to have a function on the view that allows one to set the object for that view. Something like </p>
  
  <pre><code>view.SetCustomer(Customer c); 
  </code></pre>
  
  <p>then if the view contains a child view it knows to set it on the child view ala: </p>
  
  <pre><code>this.childview1.SetCustomer(c);
  </code></pre>
  
  <p>The application is written in C# 3.5, for winforms using MVP with structure map as a IoC/DI provider. </p>