Provides access to the application data store. Application data consists of files and settings that are either local, roaming, or temporary.
var applicationData = Windows.Storage.ApplicationData;
public sealed class ApplicationData
Public NotInheritable Class ApplicationData
public ref class ApplicationData sealed
- [ DualApiPartition()]
- [ MarshalingBehavior(Agile)]
- [ Threading(MTA)]
- [ Version(0x06020000)]
The ApplicationData class has these types of members:
The ApplicationData class has these events.
|DataChanged||Occurs when roaming application data is synchronized.|
The ApplicationData class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|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.|
The ApplicationData class has these properties.
|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.|
ApplicationData provides local, temporary, and roaming storage for app data on a per-user basis. Use this class to preserve app-specific data between sessions and across multiple devices.
ApplicationData does not provide access to files in an app package. To do this, use Windows.ApplicationModel.Package.InstalledLocation.
ApplicationData.Current gives you the app's ApplicationData instance. Use this instance to get to the app data storage through one of these properties:
There are three main types of app data:
- Local: stored on the device and persists across updates.
- Roaming: copied to other devices where the user has installed the app.
- Temporary: can be deleted by the system at any time.
There are two main types of app data storage are:
- Settings: stores app data as key/value pairs that you can organize into nested sets. This data is saved in the Windows registry.
- Folders: stores app data as files on the file system.
For more details on using these APIs, see Accessing app data with the Windows Runtime.
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;
using Windows.Storage; ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
Dim localSettings As Windows.Storage.ApplicationDataContainer = Windows.Storage.ApplicationData.Current.LocalSettings
using namespace Windows::Storage; ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings;
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|
- Quickstart: Local application data (C#/VB/C++)
- Quickstart: Roaming application data (C#/VB/C++)
- Quickstart: Temporary application data (C#/VB/C++)
- Application data overview
- Guidelines for roaming application data
- Guidelines for app settings
- Application settings sample
- Application data sample
Build date: 11/16/2013