title: Passing data in a pop/back event to a previous view model
body: <p>I have a structure like so :</p>
  
  <p>SessionsView -> CreateSessionView</p>
  
  <p>with view models like so :</p>
  
  <p>SessionsViewModel - List of <code>Session</code> objects</p>
  
  <p>CreateSessionViewModel - Single <code>Session</code> Object</p>
  
  <p>The user fills in a form in create session, populates the <code>Session</code> object on the view model, hits done and I call : <code>NavigationController.PopViewControllerAnimated(true)</code> to take them back to the list of sessions. </p>
  
  <p>Is there a way of passing my newly created session object back to the previous views Viewmodel and adding it to its list of session objects? I know how to pass params in a <code>ShowViewModel&lt;TYPE&gt;(PARAM)</code> command, but not sure how to do it whilst navigating back.</p>
  
  <p><strong>Update 1 :</strong></p>
  
  <p>I found 'a' way to do it.. doesn't feel too nice though :</p>
  
  <pre><code>var sessionsView = (SessionsView)NavigationController.ViewControllers.FirstOrDefault(vc =&gt; vc is SessionsView);
                      var sessionsViewModel = (SessionsViewModel)sessionsView.ViewModel;
                      sessionsViewModel.Sessions.Add(vModel.Session);
                      NavigationController.PopViewControllerAnimated(true);
  </code></pre>