void LabBlessePage_Loaded(object sender, RoutedEventArgs e)
{
Microsoft.Phone.Shell.SystemTray.ProgressIndicator = new Microsoft.Phone.Shell.ProgressIndicator();
m_progressIndicatorHelper = new ProgressIndicatorHelper(Microsoft.Phone.Shell.SystemTray.ProgressIndicator, () =>
{
String firstLoad = PreferenceHelper.GetPreference("Global_FirstLoadBlessList");
if (String.IsNullOrEmpty(firstLoad))
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
PreferenceHelper.SetPreference("Global_FirstLoadBlessList", "WhatEver");
MessageBox.Show("发表在心语墙上的内容,写得比较好的会显示在软件启动页上哦~", "^_^", MessageBoxButton.OK);
});
}
});
if (blessHelper == null)
blessHelper = new BlessHelper();
m_progressIndicatorHelper.PushTask();
blessHelper.FetchBlessItem(25, false, (list) =>
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
Items.Clear();
if (list != null)
{
int i = 0;
foreach (BlessItem item in list)
{
item.index = i++;
Items.Add(item);
}
}
m_progressIndicatorHelper.PopTask();
});
});
}