Windows phone 8 移除wp8中激活的应用程序_上的隔离存储密钥/值对

Windows phone 8 移除wp8中激活的应用程序_上的隔离存储密钥/值对,windows-phone-8,Windows Phone 8,在Application_Deactivated事件中,我将数据存储到IsolatedStorageSettings.ApplicationSettings中,作为键/值对 在Application_Activated和Application_Closing事件中,我正在从IsolatedStorageSettings.ApplicationSettings中删除数据 但是,当我在删除数据后检查隔离存储设置时,仍然存在键/值对 我确信我已经删除了应用程序激活和应用程序关闭中的键/值对。我可以看到

在Application_Deactivated事件中,我将数据存储到IsolatedStorageSettings.ApplicationSettings中,作为键/值对

在Application_Activated和Application_Closing事件中,我正在从IsolatedStorageSettings.ApplicationSettings中删除数据

但是,当我在删除数据后检查隔离存储设置时,仍然存在键/值对

我确信我已经删除了应用程序激活和应用程序关闭中的键/值对。我可以看到打印的调试行“删除”

除了应用程序事件之外,我没有其他地方保存数据

请帮帮我。。我不知道到底哪里出了问题。删除后,数据如何仍然存在于IsolatedTotage中

我正在删除以下数据:

    public void Remove(string token)
    {
        var store = IsolatedStorageSettings.ApplicationSettings;

        if (token != null && store.Contains(token))
        if (store.Remove(token) == true)
        {
            Debug.WriteLine("deleted after Remove " + token);
        }
        else
        {
            Debug.WriteLine("Not deleted after Remove " + token);
        }
    }

删除密钥后必须保存设置

IsolatedStorageSettings.ApplicationSettings.Save();
编辑:在你的情况下

public void Remove(string token)
    {
        var store = IsolatedStorageSettings.ApplicationSettings;

        if (token != null && store.Contains(token))
        if (store.Remove(token) == true)
        {
            //Save it here : 
            store.save();
            Debug.WriteLine("deleted after Remove " + token);
        }
        else
        {
            Debug.WriteLine("Not deleted after Remove " + token);
        }

       //Or call it here : 
        store.save();
    }