5

I want to be able to change a setting in my silverlight assembly at runtime, i want a bit like a web.config in a asp.net web site?

what is the best way of doing this?

thank you

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
Jonathan D
  • 1,364
  • 2
  • 12
  • 30

1 Answers1

6

Have a look at IsolatedStorageSettings. You have ApplicationSettings (specific to a single application on a site) and SiteSettings (for all applications at a particular domain). Note that in both cases, settings are specific to a user.

A quick example:

private void StoreSetting(string key, string value)
{
   IsolatedStorageSettings.ApplicationSettings[key] = value;
}

private string GetSetting(string key)
{
   return IsolatedStorageSettings.ApplicationSettings[key];
}
Samuel Jack
  • 32,712
  • 16
  • 118
  • 155