This is a mirror of official site: http://jasper-net.blogspot.com/

Settings in Silverlight

| Monday, June 6, 2011
A few months ago I was developing a Silverlight Line of Business Application with a customer when I stumbled across the requirement to store some information over multiple user sessions - user works with the app, closes the browser and reopens the browser and works with the app again. My first idea was to store the info in a cookie. It all worked out fine until I started to enable the localization using the culture/uiculture param. Setting these results in just the culture values are found in the cookie (Ahmmm… could anybody fix this please).

The other option (the only one left) is to use the isolated store. It’s a few lines more to code than using a cookie (the reason this was my second shot) but gives you the advantage of e.g. Silverlight 3.0 out-of-browser-experience support.

I was just about to add a new item to my solution – while I was awaiting the dialog to come up – when I wondered how a developer could easily define and edit settings. Some Visual Studio support would be great. The default resources dialog for example… wait … wasn’t there some settings feature in desktop apps since .NET 2.0? Yep, it’s called “Settings”. It’s exactly what I wanted – even more as you can store values at machine level, which cannot be achieved using Silverlight (currently?).

It has an item template to easily add it to a project.

Posted via email from Jasper-net

0 comments: