【发布时间】:2014-06-07 04:40:14
【问题描述】:
我想在处理某些数据时向我的应用程序添加一个进度条。
在 XAML 中:
ProgressBar x:Name="progressBar1" Value="{Binding progressPercent}" Maximum="100" Margin="10,209,10,63" Grid.Row="5" RenderTransformOrigin="0.5,0.5">
在 C# 中:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
progressBar1.IsIndeterminate = true;
progressBar1.Value = progressPercent;
for(int i=0;i<5;i++)
{
if(count[i] == 1)
{
t=1;
break;
}
} // and the code continues
但是当我使用断点检查IsDeterminate 属性时,它并没有变为真。
谁能告诉我这是什么问题?
【问题讨论】:
-
你在哪里设置断点?在函数完成之前,UI 不会更新,这可能需要一段时间,您可以在最后重新设置值。 CPU 处理应在单独的线程上完成。
-
即使我不使用断点,进度条在任何情况下都不会出现。我在这一行中使用了断点:progressBar1.Value = progressPercent;
标签: c# windows-phone-8