HTML and CSS Reference
In-Depth Information
Important If you use the roamingSettings dictionary instead of localSettings, then all of
your stored data will be automatically synchronized by Windows 8 across all devices and
computers running the application under the same Windows account. This means that
you can set a preference on, say, a Microsoft Surface device and retrieve that setting when
you use the same application on a PC equipped with Windows 8. The API for reading
and writing data to the roamingSettings dictionary is identical to the API required for
localSettings . The only barrier to using roamingSettings by default is whether the stored
data does really make sense if used on a different device. Usually, this is not an issue with
settings that represent user preferences on the configuration of an application.
Saving to the local disk
As you've seen so far, Windows Store applications can gain a partial access to the local disk. You can
programmatically access the Documents or Pictures folder and read and create files there. You can use
file pickers to gain access to any file in nearly any folder. However, you can't programmatically point
your code to the root folder of a drive and start creating files and subfolders there. To fully use the
local disk, you need to rely on file pickers.
It is important to note that while programmatic access to known folders such as Documents and
Pictures is permitted, it is still subject to user's approval. More precisely, a Windows Store application
that needs to manipulate a known folder must pre-emptively declare its intention so that the user
installing the application can be notified by the operating system. You do this by opening the manifest
file of the project in Microsoft Visual Studio and selecting the Capabilities tab (see Figure 10-7).
FIGURE 10-7 Declaring required capabilities in a Windows Store application.
Search WWH ::




Custom Search