HTML and CSS Reference
In-Depth Information
Selecting a folder
Another common scenario is when your application just needs users to select a folder; not a file.
Windows 8 has a handy object for the purpose—the FolderPicker object. You use this object in much
the same way you use other pickers.
// Create the picker object and set options
var folderPicker = new Windows.Storage.Pickers.FolderPicker();
folderPicker.fileTypeFilter.replaceAll(["*"]);
folderPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.
desktop;
To display the user interface, you need the following code:
folderPicker.pickSingleFolderAsync().then(function (folder) {
if (folder) {
TodoList.alert(folder.name);
}
});
Note that the application gains read/write access not just on the selected folder but also on all
subfolders.
The Share contract
If you've used Windows, you should know about the Windows clipboard. It's a system feature that
allows users to copy data from one application (typically with Ctrl+C) and paste that into another
(typically with Ctrl+V). The clipboard does support a variety of formats—data can be copied as plain
text, rich text, and bitmap, but also application-specific formats are supported.
The clipboard is essentially a user-oriented feature, but it was backed by a programming interface
in all versions of Windows. Windows Store applications have no access to the clipboard, but that
doesn't mean that distinct applications can't communicate and exchange data. Instead of the
clipboard, a user will just use the Share menu from the Charms bar.
publishing an application's data
In this exercise, you'll learn how to make some application-specific data potentially available to any
other applications registered to receive shared data. The exercise consists of extending the TodoList
application to make it act as a Share source application.
Search WWH ::




Custom Search