Gets the application settings container in the local app data store.
Syntax
public: property ApplicationDataContainer^ LocalSettings { ApplicationDataContainer^ get(); }
Property value
Type: ApplicationDataContainer
The application settings container.
Remarks
The name of each setting can be 255 characters in length at most. Each setting can be up to 8K bytes in size and each composite setting can be up to 64K bytes in size.
The Windows Runtime data types are supported for app settings.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
Use the LocalSettings | localSettings property to get the settings in an ApplicationDataContainer object. Use the ApplicationDataContainer.Values | values property to access the settings in the localSettings container. This example creates and reads a setting named exampleSetting.
Call the ApplicationDataContainerSettings.Remove | remove method to delete the exampleSetting setting when you have finished with it.
ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings; // Create a simple setting auto values = localSettings->Values; values->Insert("exampleSetting", dynamic_cast<PropertyValue^>(PropertyValue::CreateString("Hello Windows"))); // Read data from a simple setting auto values = localSettings->Values; String^ value = safe_cast<String^>(localSettings->Values->Lookup("exampleSetting")); if (!value) { // No data } else { // Access data in value } // Delete a simple setting values->Remove("exampleSetting");
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
|
DLL |
|
See also
- Tasks
- Quickstart: Local application data (JavaScript)
- Quickstart: Local application data (C#/VB/C++)
- Concepts
- Application data overview
- Reference
- ApplicationData
Build date: 2/25/2013