Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem Storing a list of Objects in Isolated Storage
    primarykey
    data
    text
    <p>I am trying to store a list of objects I created in the isolated storage and be able to display them in a list by auto generating a title for them. So far the code works but once I tombstone the app and start it up all my data is saved except for the list of objects. I think my problem may be with how I initialize the list in the first place, or possibly how I am displaying the names. Any help is appreciated.</p> <p>this code is in my App.xaml.cs:</p> <pre><code>public partial class App : Application { public List&lt;my_type&gt; testList = new List&lt;my_type&gt;(); void loadvalues() { IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; List&lt;my_Type&gt; L; if (settings.TryGetValue&lt;List&lt;DrinkSesh&gt;&gt;("Storage", out L)) { testList = L; } } void savevalues() { IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; settings["Storage"] = testList; settings.Save(); } } </code></pre> <p>This code is on my mainPage to add the items to the list:</p> <pre><code>(Application.Current as App).testList.Add(new my_type()); </code></pre> <p>and this code is to implement the titles onto the screen on a different page:</p> <pre><code> public different_class() { { InitializeComponent(); for (i = 0; i &lt; (Application.Current as App).testList.Count; i++) { CreateATextBlock((Application.Current as App).testList[i].Title_ToString(), i); } } private void CreateATextBlock(String title,int num) { testblockname = new TextBlock(); testblockname.Text = (num + 1) + ". " + title; DrList.Children.Add(testblockname); } } </code></pre> <p>Thank you in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload