HTML and CSS Reference
In-Depth Information
You first get the object that references the task currently displayed in the editor, and then you get
the name of the corresponding fileā€”in this case, the file name matches the description of the task.
Finally, you locate the file in the roaming folder. This is done by using the getFileAsync method, which
returns a reference to a single file, if it exists. To delete the file, you use the deleteAsync method.
When done, you clear up the editor and refresh the list view to remove the deleted task.
Using files is a necessity for any serious application. Windows Store applications are no exception. In
this chapter, you have learned the basics of file operations and the various storage options that are
available to applications. Of particular interest for Windows Store applications are the roaming folder
and roaming settings. By storing data in the roaming folder, and/or user settings in the roaming
settings dictionary, you enable the operating system to synchronize that data across the cloud so that
any other copy of the application running on other devices (under the same Windows account) can
use it.
If this story hasn't caught you enough yet, think of some fairly impressive commercials of the iOS
system you may have seen some time ago. In the commercial, a user on a train is reading a given
page of an e-book with an iPad. Then she gets back home and sits comfortably in front of a Mac
computer. She runs the same application and, magically, she is served the last page read. You can
achieve the same kind of magic in your Windows Store application by using the roaming folder and
roaming settings.
Another piece that you need to add to the Windows Store puzzle is getting remote data that is
accessible over the Internet. This is the topic of the next chapter.
Search WWH ::

Custom Search