Application Settings in Windows Phone

Application Settings is the most useful and easiest way to store and access data in Windows Phone, it is a wonderful name value pair dictionary. If we want to store setting we use the ApplicationSettings object in Isolated Storage. Basically it is used for properties, settings and other commonly used data in your application.

Saving Data

private void saveData(string message)

{

IsolatedStorageSettings.ApplicationSettings["score"] = message;IsolatedStorageSettings.ApplicationSettings.Save();

}

Load Data

private string loadData()

{

if (IsolatedStorageSettings.ApplicationSettings.Contains("score"))

{return (string)IsolatedStorageSettings.ApplicationSettings["score"];

}

elsereturn null;

}

It is as simple as the code seems above, lets see a quick demo on how it works.

http://www.youtube.com/watch?v=_YenMJ3MRSA

Ebook Download
View all
Learn
View all