Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ApplicationData.RoamingSettings | roamingSettings property

Applies to Windows and Windows Phone

Gets the application settings container in the roaming app data store.

Syntax


var roamingSettings = applicationData.roamingSettings;

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 sync engine may limit the total size of settings and files that can roam.

The Windows Runtime data types are supported for app settings.

Examples

Use the RoamingSettings | roamingSettings property to get the settings in an ApplicationDataContainer object. Use the ApplicationDataContainer.Values | values property to access the settings in the roamingSettings 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.


var applicationData = Windows.Storage.ApplicationData.current;

var roamingSettings = applicationData.roamingSettings;

// Create a simple setting

roamingSettings.values["exampleSetting"] = "Hello World";

// Read data from a simple setting

var value = roamingSettings.values["exampleSetting"];
        
if (!value)
{
    // No data
}
else
{
    // Access data in value
}

// Delete a simple setting

roamingSettings.values.remove("exampleSetting");

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

DLL

Windows.Storage.ApplicationData.dll

See also

Tasks
Quickstart: Roaming application data (JavaScript)
Quickstart: Roaming application data (C#/VB/C++)
Concepts
Application data overview
Reference
ApplicationData

 

 

Show:
© 2014 Microsoft