我想救我的獨立存儲模型:我無法保存到獨立存儲?
var settings = IsolatedStorageSettings.ApplicationSettings;
CurrentPlaceNowModel model = new CurrentPlaceNowModel();
settings.TryGetValue<CurrentPlaceNowModel>("model", out model);
if (model == null)
{
MessageBox.Show("NULL");
settings.Add("model", new CurrentPlaceNowModel());
settings.Save();
}
else
MessageBox.Show("NOT NULL");
當我開始鴯鶓我ofcourse的「NULL」,但爲什麼我不斷收到它,如果我關上了動車組,並啓動應用程序它再次從菜單(不在Visual Studio中再次啓動它)。
我不應該第二次得到「NOT NULL」嗎?
「設置」究竟是什麼?我可以嘗試猜測,但我寧願不必... – 2012-03-16 19:52:40
設置是var settings = IsolatedStorageSettings.ApplicationSettings; ive更新了代碼 – Jason94 2012-03-16 20:07:05