ApplicationDataCompositeValue constructor

ApplicationDataCompositeValue.ApplicationDataCompositeValue constructor

Creates and initializes a new, initially empty, instance of the object.

Syntax


var applicationDataCompositeValue = new Windows.Storage.ApplicationDataCompositeValue();

Parameters

This constructor has no parameters.

Examples

This example creates and reads a composite setting named exampleCompositeSetting.

Call the Remove | remove method to delete the exampleCompositeSetting setting when you have finished with it.


var applicationData = Windows.Storage.ApplicationData.current;

var localSettings = applicationData.localSettings;

// Create a composite setting

var composite = new Windows.Storage.ApplicationDataCompositeValue();
composite["intVal"] = 1;
composite["strVal"] = "string";

localSettings.values["exampleCompositeSetting"] = composite;

// Read data from a composite setting

var composite = localSettings.values["exampleCompositeSetting"];

if (!composite)
{
    // No data
}
else
{
    // Access data in composite["intVal"] and composite["strVal"]
}

// Delete a composite setting

localSettings.values.remove("exampleCompositeSetting");

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

See also

Tasks
Quickstart: Local application data (JavaScript)
Store and retrieve settings and other app data
Quickstart: Roaming application data (JavaScript)
Store and retrieve settings and other app data
Concepts
Store and retrieve settings and other app data
Reference
ApplicationDataCompositeValue

 

 

Show:
© 2016 Microsoft