App settings are packaged data storage in Windows Phone, a collection of key-value pairs saved in the application store, which automatically serializes objects and saves them in the application.
When the application is deleted, the saved data disappears as well, and this method primarily stores some application settings information.
Basic Features:
1, the application settings have a hierarchy of containers, so the container can also be nested inside the container, the container can nest up to 32 layers.
2. The application settings store a single data type object.
How to use:
1. Get the local Application settings container:
Applicationdatacontainer _appsetting = ApplicationData.Current.LocalSettings;
2, add and modify should be set
_appsetting.values["keys""WP Learning ";
Note: If a key does not exist, a new one is added, and if there is already a key, the original value is modified.
3. Reading should be set
string values = _appsetting.values[keys]. ToString ();
4. Delete app settings
_appsetting.values.remove ("keys");
To set the presence container:
// created if the container does not exist Applicationdatacontainer container = _appsetting.createcontainer ("newcontainer", Applicationdatacreatedisposition.always);
Delete Container
_appsetting.deletecontainer ("newcontainer");
Adding information on a new container
// determine if the container exists if (_appsetting.containers.containskey ("newcontainer")) { _appsetting.containers["newcontainer"]. values["keys""hello wp"; }
Delete information on a container
if (_appsetting.containers.containskey ("newcontainer")) { _appsetting.containers["newcontainer"]. Values.remove ("keys");
Windows Phone app settings container object Applicationdatacontainer