title: What determines whether NavigationCommands.BrowseBack calls the page constructor?
body: <p>I have two pages with similar logic in them. Load the page, click some buttons that will show/hide other buttons, continue to next page. When I hit the next page, if I click the back button I am returned to the previous page. </p>
  
  <p>The difference is that one page (FirstPage) will have the constructor called when I click the back button, which has a call to reset the defaults. The other page (SecondPage) doesn't get the constructor called and I'm not sure why.</p>
  
  <pre><code>public FirstPage()
  {
    InitializeComponent();
    DisplayStuff();
  }
  </code></pre>
  
  <p>FirstPage has <code>KeepAlive</code> set to <code>False</code>.</p>
  
  <pre><code>public SecondPage(object arg1, object arg2)
  {
    InitializeComponent();
    DisplayStuff(arg1, arg2);
  }
  </code></pre>
  
  <p>This page also has <code>KeepAlive</code> set to <code>False</code>. These two pages don't inherit from anything and there is nothing that overrides any of the properties. The only difference I can see is the empty constructor, so I tried giving SecondPage an empty constructor and still no luck.</p>
  
  <p>I'm relatively new to WPF (I work on it for an hour or two every 6 months), so what am I missing?</p>
  
  <p>Here is the back button in case it is relevant.</p>
  
  <pre><code>&lt;Button Command="{x:Static NavigationCommands.BrowseBack}" /&gt;
  </code></pre>
  
  <p>Edit: When I click the back button, SecondPage doesn't keep its state. It just loads an empty page because <code>DisplayStuff</code> hasn't been called yet.</p>
  
  <p>Navigation Code:</p>
  
  <pre><code>NavigateTo(new SecondPage(arg1, arg2));
  
  protected void NavigateTo(Page page)
  {
    NavigationService.Navigate(page);
  }
  </code></pre>