【发布时间】:2013-06-26 01:52:26
【问题描述】:
在 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............
}
我不明白为什么进度指示器变量没有初始化。
【问题讨论】:
-
它始终为空。您需要创建并设置它。
标签: windows-phone-7 windows-phone-8 progress progress-indicator