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

Saving username and password to a local store


In this recipe we will learn how to save a username and password to local storage settings.

Getting ready

For this recipe let's copy the simple MyTasks app solution folder we built in Chapter 1, Data Binding to UI Elements, and rename the folder to Ch2_Recipe3_MyTasks. After you open the project, just press F5 and run it to make sure you don't get any errors.

How to do it...

Let's add another icon in the bottom navigation bar to link it to the Settings page. Then create the Settings page with the different controls to save the username and password.

  1. First, add another bar item at the bottom to navigate to user settings page, which we will be creating in step 3:

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
      <shell:ApplicationBar BackgroundColor="Orange" IsVisible="True" IsMenuEnabled="True">
    
        <shell:ApplicationBarIconButton IconUri="/Images/appbar.folder.rest.png" Click="ButtonFolder_Click...