【发布时间】:2011-12-10 21:09:47
【问题描述】:
我有两个视图(MainPage.xaml 和 Settings.xaml)
我想在我的设置视图中保存一个字符串 并在 MainPage 中检索其内容
这是我的代码,但出现错误:
Settings.xaml.cs:
var settings = IsolatedStorageSettings.ApplicationSettings;
settings.Add("setPlan", "This is my text that i want to retreive");
MainPage.xaml.cs:
var location = settings["setPlan"].ToString();
错误是:名称“设置”在当前上下文中不存在。
但是这个“setPlan”字符串不是应该在我的沙盒中并且可以从任何视图访问吗?
【问题讨论】:
标签: c# xaml windows-phone-7 isolatedstorage