在 MainPage 我有一个按钮。当用户单击该按钮时,我正在初始化进度指示器变量。但它没有初始化,并且在调试时显示为空。那么,我们应该如何在 windows phone 8 中为某些任务显示进度指示器。
下面是我的代码。
ProgressIndicator pi;
private void search_button_clicked(object sender, RoutedEventArgs e)
{
pi = Microsoft.Phone.Shell.SystemTray.ProgressIndicator;
//Show the indicator
pi.IsVisible = true;//Here I'm getting null reference exception
........here the code for download xml file by calling web service............
}
我不明白为什么进度指示器变量没有初始化。