title: Windows 8 phone Saving and loading a list of Objects
body: <p>I would like to save and load my History list filled with History Entry objects. I am trying to do this through Isolated Storage, so that when the user opens and closes the app none of their browsing history is lost. It is saved which can be loaded once the app is clicked. I have had a look around and saw this question on stackoverflow, and I have tried to follow it but came across so errors. <a href="https://stackoverflow.com/questions/18197696/isolated-storage-saving-multiple-objects">Isolated Storage &amp; Saving Multiple Objects</a>.</p>
  
  <p>Here is the code</p>
  
  <p>The HistoryEntry class</p>
  
  <pre><code>public string URL { get; set; }
  public string timestamp { get; set; }
  public string date { get; set; }
  </code></pre>
  
  <p>The MainPage code:</p>
  
  <pre><code>using System.Xml.Serialization;
  using System.Collections.ObjectModel;
  using System.IO;
  
  List&lt;HistoryEntry&gt; urls = new List&lt;HistoryEntry&gt;();
  public HistoryEntry selectedHistory;
  
  public MainPage()
  {
      InitializeComponent();
      Deserialize&lt;&gt;(urls, ???);
  }
  
  void Browser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
  {
       HistoryEntry urlObj = new HistoryEntry();
       urlObj.URL = url;
       urlObj.timestamp = DateTime.Now.ToString("HH:mm");
       urlObj.date = url.Remove(url.LastIndexOf('.'));
       urls.Add(urlObj);
  
       textBox1.Text = url;
       listBox.ItemsSource = null;
       listBox.ItemsSource = urls;
  
       Serialize(urlObj, urls);
  }
  
  private static void Serialize(string fileName, object source)
  {
      var userStore = IsolatedStorageFile.GetUserStoreForApplication();
      using (var stream = new IsolatedStorageFileStream(fileName, FileMode.Create, userStore))
      {
          XmlSerializer serializer = new XmlSerializer(source.GetType());
          serializer.Serialize(stream, source);
      }
  }
  
  public static void Deserialize&lt;T&gt;(ObservableCollection&lt;T&gt; list, string filename)
  {
      list = new ObservableCollection&lt;T&gt;();
      var userStore = IsolatedStorageFile.GetUserStoreForApplication();
      if (userStore.FileExists(filename))
      {
          using (var stream = new IsolatedStorageFileStream(filename, FileMode.Open, userStore))
          {
              XmlSerializer serializer = new XmlSerializer(list.GetType());
              var items = (ObservableCollection&lt;T&gt;)serializer.Deserialize(stream);
              foreach (T item in items)
              {
                  list.Add(item);
              }
          }
      }
  }
  </code></pre>
  
  <p>Serialize has some invalid arguments which is the same with when De serialize is called. What are the appropriate values to be sent to the method, and will this successfully save and load the history objects.</p>
  
  <p>Thank you in advance :)</p>
  
  <p>If you need any more details please comment and I will be happy to explain in further detail :)</p>