An ApplicationDataCompositeValue object contains settings that must be accessed atomically. This example creates a composite setting named exampleCompositeSetting and adds it to the roamingSettings container.

' Setting in a container
Dim container As Windows.Storage.ApplicationDataContainer =
roamingSettings.CreateContainer("exampleContainer", Windows.Storage.ApplicationDataCreateDisposition.Always)
If roamingSettings.Containers.ContainsKey("exampleContainer") Then
roamingSettings.Containers("exampleContainer").Values("exampleSetting") = "Hello World"
End If

' Composite setting
Dim composite As Windows.Storage.ApplicationDataCompositeValue =
CType(roamingSettings.Values("exampleCompositeSetting"), Windows.Storage.ApplicationDataCompositeValue)
If composite Is Nothing Then
' No data
Else
' Access data in composite("intVal") and composite("strVal")
End If

' Setting in a container
Dim hasContainer As Boolean = roamingSettings.Containers.ContainsKey("exampleContainer")
Dim hasSetting As Boolean = False
If hasContainer Then
hasSetting = roamingSettings.Containers("exampleContainer").Values.ContainsKey("exampleSetting")
End If

Roam data across different types of devices

If you publish two versions of your app - a version for Windows Store and a version for Windows Phone Store - you can roam app data across the apps running on the two different types of devices. To roam data across different versions of your app on different types of devices, assign the same Package Family Name (PFN) to each version of the app.

Remarks

Each app has a quota for roaming app data. Check the ApplicationData.RoamingStorageQuota property to determine the total size of roaming data allowed. If your roaming data exceeds the quota, it won’t roam until its size is less than the quota again.