Book Image

Windows Phone 7.5 Data Cookbook

By : Ramesh Thalli
Book Image

Windows Phone 7.5 Data Cookbook

By: Ramesh Thalli

Overview of this book

Windows Phone 7.5 Mango contains support for apps written in Silverlight or XNA. These apps can store data on the device, and also load and manipulate data from "the cloud" and other web services.This Windows Phone 7.5 Data Cookbook has a range of recipes to help you apply data handling concepts. You will be able to apply the knowledge gained from these recipes to build your own apps effectively. This Windows Phone 7.5 Data Cookbook starts with data binding concepts at the UI layer and then shows different ways of saving data locally and externally in databases. The book ends with a look at the popular MVVM software design pattern. The recipes contained in this book will make you an expert in the areas of data access and storage.
Table of Contents (15 chapters)
Windows Phone 7.5 Data Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


In Windows Phone 7 environment, local storage is the space available for each application. We can read and write data in this area, but we do not have access to other applications' storage areas or direct access file systems. Isolated storage is the virtual file system available within the application.

There are two main classes used; one is IsolatedStorageSettings class and other is IsolatedStorageFile class. Both classes are part of the namespace System.IO.IsolatedStorage.

IsolatedStorageSettings uses the dictionary mechanism to store data, hence it uses a key and a value pair for storing any value. Some of the most commonly used methods are Add, Remove, and Contains.

The IsolatedStorageFile class uses isolated storage with files and directories. Therefore, you can save any file stream to the local storage using IsolatedStorageFileStream. Some of the common methods used for managing the files are FileExists, CreateFile, OpenFile, and DeleteFile. Similarly, DirectoryExists,...