With this code I can have Silverlight ask the user if he wants to increase IsolatedStorage:
private void Button_IncreaseIsolatedStorage_Click(object sender, RoutedEventArgs e)
{
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
long newStorageCapacityInBytes = FileHelpers.GetMaxiumumSpace() + SystemHelpers.GetAmountOfStorageToIncreaseWhenNeededInBytes();
store.IncreaseQuotaTo(newStorageCapacityInBytes);
Message = "IsolatedStorage increased. " + FileHelpers.GetSpaceLeftMessage();
}
But if I try to set it to an amount less than it current is, I get an error that this is not possible.
Is there a workaround for this, i.e. can I reduce the amount of IsolatedStorage? This would be useful for testing purposes at least.
Related question: When the user agrees to increasing IsolatedStorage, can other applications use this capacity or just the application in which he increased it? I assume this is the reason the above limitation is there.