Windows 8 开发系列- App Resume的静态突然清空问题

NavigateMode与App Resume的冲突

 

Loadstate是启动页面加载的;

SaveState是离开页面是加载的;

Suspending是挂起应用;

Resuming是恢复应用;

当设置-NavigateMode时,恢复应用时,很无语的发现静态变量在进行循环会变0;

for (int i = 0; i < LocalStorage.Data.Count; i++)
{

Attention at = LocalStorage.Data[i] as Attention;
await LocalStorage.RestoreAttentionImageAsync(at);
}

后来只能再转换成局部变量

ist<object> currendata = new List<object>();
currendata.AddRange(LocalStorage.Data);

 








posted on 2012-11-20 13:56  SUNJUNLIN  阅读(209)  评论(0编辑  收藏  举报

导航