title: How to Pass Data Between Pages using OnNavigatedFrom and OnNavigatedTo Events
body: <p>I have two pages in my application. The Navigation follows MainPage > EditPage > MainPage. MainPage is the starting page and edit page may be NavigatedTo upon a button click and NavigatedFrom using the hardware back button. If some action occurs in EditPage, I would like to inform MainPage when the user wishes to return to MainPage. I have referenced <a href="http://mobile.dzone.com/articles/passing-values-between-windows" rel="nofollow">http://mobile.dzone.com/articles/passing-values-between-windows</a> but I am not sure how fix the MainPage OnNavigatedTo event accordingly. SO far what I have is as follows</p>
  
  <p>MainPage.xaml.cs</p>
  
  <pre><code>protected override void OnNavigatedTo(NavigationEventArgs e)
      {
          //If action in EditPage occurred, determine that here
          ??
      }
  </code></pre>
  
  <p>EditPage.xaml.cs</p>
  
  <pre><code>protected override void OnNavigatedFrom(NavigationEventArgs e)
      {
          base.OnNavigatedFrom(e);
  
          //check to see if action occurred in EditPage, and if so, inform MainPage
          if (_wasEdited == true)
          {
              MainPage mp = e.Content as MainPage;
              if (mp != null)
                  mp.Parameter = true;
          }
      }
  </code></pre>