简体   繁体   中英

Windows 8.1 Store App, saving user variables between app states

I am currently making a Windows 8.1 store app that acts as a task manager for user created events.
I need to save a variable so that if the user terminates the app it persists. Declared in MainPage.xaml.cs I have this list

public static ObservableCollection<events> eventsList = new ObservableCollection<events>();

Is there an easy way to save this so that the events a user creates are always there? I have read several of the MSDN pages on application state and most either seem to be for simple strings or ints. I appreciate any help offered.

Its better if you integrate SQlite and save your tasks inside your database. Sqlite would be a better option as then it would be easier to manage different tasks that user creates you can easily add the specific fields that you need and query results easily.
Else you can use LocalStorage to save your variable values locally(though I havent used it to save a list value, and am not sure if it allows also).
Though if you meant between app states then you must be looking for Suspension Manager to save state values during suspended mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM