title: How to prevent Xaml class from resetting variables
body: <p>When the page is reloaded either by clicking on the Home -&gt; Page3 or the Page3 button the <code>cartTitleListDisplay</code> list gets reset, is there a way to prevent this?</p>
  <p>List Creation:</p>
  <pre><code>List&lt;string&gt; cartTitleListDisplay = new List&lt;string&gt;();
  </code></pre>
  <p>The program works by getting the data via sending the variable data to the Page3 navigation button on the MainPage and collecting it on Page3, Page3 has a safety to prevent if null information was added and then displays the information on Page3</p>
  <pre><code>protected override void OnNavigatedTo(NavigationEventArgs e)
  {
      List&lt;string&gt; cart1temp = e.Parameter as List&lt;string&gt;;
  
      if (cart1temp != null)
      {
      cartTitleListDisplay.AddRange(cart1temp);
      }
  
      if (cartTitleListDisplay != null)
      {
          cartTitle1.Text = cartTitleListDisplay[0];
      }
      try
      {
          cartTitle1.Text = cartTitleListDisplay[0];
          cartPrice1.Text = cartTitleListDisplay[0];
      }
  }
  </code></pre>