Provides access to the application data store. Application data consists of files and settings that are either local, roaming, or temporary.
Syntax
var applicationData = Windows.Storage.ApplicationData;
Attributes
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.Storage.IApplicationDataStatics, NTDDI_WIN8)
- ThreadingAttribute(MTA)
- VersionAttribute(NTDDI_WIN8)
Members
The ApplicationData class has these types of members:
Events
The ApplicationData class has these events.
| Event | Description |
|---|---|
| DataChanged | Occurs when roaming application data is synchronized. |
Methods
The ApplicationData class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| ClearAsync() | Removes all application data from the local, roaming, and temporary app data stores. |
| ClearAsync(ApplicationDataLocality) | Removes all application data from the specified app data store. |
| SetVersionAsync | Sets the version number of the application data in the app data store. |
| SignalDataChanged | Sends a DataChanged | datachanged event to all registered event handlers. |
Properties
The ApplicationData class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Provides access to the app data store associated with the app's app package. | |
| Read-only | Gets the root folder in the local app data store. | |
| Read-only | Gets the application settings container in the local app data store. | |
| Read-only | Gets the root folder in the roaming app data store. | |
| Read-only | Gets the application settings container in the roaming app data store. | |
| Read-only | Gets the maximum size of the data that can be synchronized to the cloud from the roaming app data store. | |
| Read-only | Gets the root folder in the temporary app data store. | |
| Read-only | Gets the version number of the application data in the app data store. |
Remarks
An app can also include files in its app package. To access files in the app package, use Windows.ApplicationModel.Package.Current.InstalledLocation.
Examples
The following code example demonstrates how to get the local settings container for the app.
var applicationData = Windows.Storage.ApplicationData.current; var localSettings = applicationData.localSettings;
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
|
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++)
- Quickstart: Temporary application data (JavaScript)
- Quickstart: Temporary application data (C#/VB/C++)
- Concepts
- Application data overview
- Guidelines
- Guidelines for roaming application data
- Guidelines for app settings
- Reference
- ApplicationDataCompositeValue
- ApplicationDataContainer
- ApplicationDataContainerSettings
- Samples
- Application settings sample
- Application data sample
Build date: 2/25/2013