开发者

Storing application settings in Silverlight

开发者 https://www.devze.com 2023-01-05 13:42 出处:网络
I want to be able to change a setting in my silverlight assembly at runtime, i want a bit like a web.config ina as开发者_高级运维p.net web site?

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 as开发者_高级运维p.net web site?

what is the best way of doing this?

thank you


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];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号