ApplicationDataContainer.Values | values property

Applies to Windows and Windows Phone

Gets an object that represents the settings in this settings container.

Syntax


public:
property IPropertySet^ Values { 
   IPropertySet^ get();
}

Property value

Type: IPropertySet

The settings map object.

Examples

Use the LocalSettings | localSettings property to get the settings in an ApplicationDataContainer object. Use the ApplicationDataContainer.Values | ApplicationDataContainer.values property to access the settings in the localSettings container. This example creates and reads a setting named exampleSetting.

Call the ApplicationDataContainerSettings.Remove | ApplicationDataContainerSettings.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.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: Local application data (JavaScript)
Quickstart: Local application data (C#/VB/C++)
Quickstart: Roaming application data (JavaScript)
Quickstart: Roaming application data (C#/VB/C++)
Concepts
Application data overview
Reference
ApplicationDataContainer

 

 

Show:
© 2014 Microsoft