Clearing Settings - return to default

2 posts, 0 answers
  1. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 26 Sep 2011 Link to this post

    We have a composite application and each module can and will load in xaml pages as needed and I would like the ability to save the settings for a given page, not just everything loaded. Likewise I need the ability to delete stored settings for only a given page and not all stored settings.

    Some of this seems doable with a stream but I was currently using IsolatedStorage.

    Any ideas?
  2. Alex Fidanov
    Alex Fidanov avatar
    636 posts

    Posted 29 Sep 2011 Link to this post

    Hi Tyree,

    The IsolatedStorageProvider uses the PersistenceManager's storage, which holds all of the controls marked with the StorageId propery. You can access this storage with the PersistenceManager.GetStorage() static method. If you want to save only certain files, you could remove the control that are not to be saved from that storage and call SaveToStorage method.

    In regards to deleting only specific settings, you can access the isolated storage with the GetIsolatedStoreOverride method of the IsolatedStorageProvider. Please note that this method is protected and you have to subclass the provider to use it. For example, you can extend this class in the following way:

    public class IsolatedStorageProviderEx : IsolatedStorageProvider
        public void DeleteFile(string file)
            var store = this.GetIsolatedStoreOverride();
            using (store)
                if (store.FileExists(file))
    Please note that the file's extension is ".bin". With the upcoming versions, the extension will be exposed as a property of the provider.

    Best wishes,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top