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

Navigating the XML file


In this recipe, let's look more into navigating the XML file. There are many ways to navigate. Here we will learn how to load the XML file directly and find specific information and return it using LINQ methods.

Getting ready

Let's add a new project called Recipe4_SearchXml to our Ch3_Recipes solution. Copy DataClass.cs and MyTasks.xml from the first recipe. Change the name of the page to SearchXml.

How to do it…

In the following steps, let's create an application to get the priority of a task by navigating the XML document:

  1. Let's use the MyTasks.xml we created earlier:

    <?xmlversion="1.0"encoding="utf-8" ?>
    <tasks>
      <taskname="name 1" notes="notes 1" priority="Low"datedue="03/01/2011" datecreated="02/01/2011"/>
    
      <taskname="name 2" notes="notes 2" priority="High"datedue="04/01/2011" datecreated="02/01/2011"/>
    
      <taskname="name 3" notes="notes 3" priority="Medium"datedue="05/01/2011" datecreated="02/01/2011"/>
    </tasks>
  2. In the XML file...