我收集了gotoWeb.xaml.cs
中的用户输入,并将收集的输入存储在隔离存储中。我需要将存储的变量传递给MainPage.xmal.cs
。我不知道该怎么做?如何在cs页面之间传递变量?
我在MainPage.xaml中需要此var Page1
和var Page2
。这个怎么做 ?
守则gotoWeb.xaml
IsolatedStorageSettings.ApplicationSettings["Page1"] = site;
IsolatedStorageSettings.ApplicationSettings.Save();
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
//store it in the settings
if (!settings.Contains("qsPage1"))
{
//if setting has not been created, add it
settings.Add("qsPage1", site);
}
else
{
//store a the page in the setting
settings["qsPage1"] = site;
}
var Page1 = IsolatedStorageSettings.ApplicationSettings["qsPage1"];
// and by using same isolated settings method, created one more varible
var Page2 = IsolatedStorageSettings.ApplicationSettings["qsPage2"];
看看像MVVM光框架可能已经为你提供这些基本功能。 –