I want to persistent user control data for user experience. Following sample code, a temp file can be used for this purpose like:
using (IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication()) { if (iso.FileExists(fileName)) iso.DeleteFile(fileName); iso.IncreaseQuotaTo(iso.Quota + memoryStream.Length); using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(fileName, FileMode.OpenOrCreate, iso)) { stream.Write(memoryStream.ToArray(), 0, (int)memoryStream.Length); } }
in this way, each control should have its own temp file in IsolatedStorage. Is it possible to have only one temp file for different control in SL app? sample code to save and populate it please.
Thanks.
Thank you. your advice is fine. I keep one file in IsolatedStorage for one XamGrid state persisted.
Hi Ben,
Let me know if you have any further questions on this matter.
First I'd just like to point out that there is nothing wrong with creating multiple isolated storage files such as the way your application currently does. Is there any particular reason as to why you want to have all this persistant data located in one file?
The Infragistics Persistence framework does not have any built in functionality for saving the persistance of multiple controls to one stream for output to a file. It will create a seperate Stream for each control that you're going to need to concatenate together into one memory stream if you want to go that route and this can be a lot more work that you may not even need to worry about. You will also need to worry about how to parse the memory stream when you read back the data later on if you combine all that persistence data into one file.