title: Use a variable on NavigationService.GoBack
body: <p><code>NavigationService.GoBack()</code>; I'm setting a variable in viewmodel and then I want to go back, when I'm back I want to use that variable, but nothing seems to run, I don't want to refresh that page.</p>
  
  <p>Any ideas?</p>
  
  <p>Here i'm setting variable, and i want to go back to my MainPage.</p>
  
  <pre><code>void item_click(object sender, RoutedEventArgs e)
     {
  
       Button b = e.OriginalSource as Button;
  
       App.ViewModel.bName = b.Content.ToString();
       App.ViewModel.bID = b.Name;
  
       this.NavigationService.GoBack();
  
      }
  </code></pre>
  
  <p>Here in my MainPage i want to run the check to se if variables has changed.</p>
  
  <pre><code>public MainPage()
  
      {
        /*
  i don't want to run this actually, when i'm coming back from my secondarypage.
  
          InitializeComponent();
          InitializeSettings();
  
  */
  
              if (App.ViewModel.bName != null)
              {
                  myButton.Content = App.ViewModel.bName;
                  myButton.Name = App.ViewModel.bID;
              }
      }
  </code></pre>