Windows Store Application (8.1) – Read/Save Settings Roaming

This article walks you through the steps for creating and read settings in your Windows Store Application. On this demo, we will use Roaming Settings to store and retrieve data on the application. Windows 8 offers the roaming settings as a tool to save and load settings for your application. It is a dictionary container where you can save and retrieve typed settings. If a roamed version exists it will be used else a local version will be used.

STEP 1 – Create Windows Store Application

  • Open Visual Studio 2013 and create a new project of type Windows Store App.
  • On this project I create a solution called Windows8IsolatedStorage.

  • After project creation, we need to implement the design. On this example, we need two textboxes and two buttons. A textbox to enter de setting and another one to enter the value of that setting. The buttons, will be used to save and read the settings information.


STEP 2 – Save/Read Settings Implementation

private void Save_Click(object sender, RoutedEventArgs e) 
            ApplicationData.Current.RoamingSettings.Values[txtSettings.Text] = txtValue.Text; 
private void Read_Click(object sender, RoutedEventArgs e) 
            if (ApplicationData.Current.RoamingSettings.Values.ContainsKey(txtSettings.Text)) 
                txtValue.Text = ApplicationData.Current.RoamingSettings.Values[txtSettings.Text].ToString(); 
                txtValue.Text = ""; 

STEP 3 – Run Application

Press F5 and check the result of the implementation. If you save a setting called “database” with value demo, and then remove the value and try to read the setting, the demo value will be displayed on the screen.

Windows 8 Resources

About João Sousa
Senior Software Engineer in .Net (Microsoft Certified MTCS and MCPD). .NET Microsoft MVP 2015

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: