title: Saving Local Data in Metro Style App
body: <p>I want to make a score mechanism in windows 8 metro style app and want to save that score locally using Windows.Storage.ApplicationData i'm having quite a hard time since im new to visual studio and App building.</p>
  
  <pre><code>var applicationData = Windows.Storage.ApplicationData.current;
  
  var localSettings = applicationData.localSettings;
  
  // Create a simple setting
  
  localSettings.values["totalPike"] = '0';
  
  // Read data from a simple setting
  
  var totalPike = localSettings.values["totalPike"];
  
  if (!totalPike) {
      // No data
  }
  else {
      // Access data in value
  }
  
  // Delete a simple setting
  
  localSettings.values("totalPike");
  </code></pre>
  
  <p>That is how windows handles app data from msdn</p>
  
  <pre><code>$(document).ready(function () {
  
          var clicks = 99;
  
          $("#totalScoreTestButton").click(function () {
              totalPike = totalPike + clicks
              $("#totalScoreTest").text(totalPike);
          });
  });
  </code></pre>
  
  <p>This is the function i use to add the score to the total score preatty basic at the time but whenever i close the app and start it again no score is saved. Can someone help me in this, and if possible explain me how Metro apps handle local data?</p>