简体   繁体   English

Windows Phone 8 App中的进度栏

[英]Progress Bar in Windows Phone 8 App

I want to add a progress bar to my application when certain data is being processed. 当某些数据正在处理时,我想向我的应用程序添加进度条。

In XAML: 在XAML中:

ProgressBar x:Name="progressBar1"  Value="{Binding progressPercent}" Maximum="100" Margin="10,209,10,63" Grid.Row="5" RenderTransformOrigin="0.5,0.5">

In C#: 在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

But the IsDeterminate property does not become true when I used a breakpoint to check it. 但是,当我使用断点进行检查时, IsDeterminate属性不会变为true。 Could anyone tell me what's the issue? 谁能告诉我这是什么问题?

I Cannot see the whole xaml of the page. 我看不到页面的整个xaml。 and code behind. 和后面的代码。 I can check 2 things. 我可以检查两件事。

  1. I will check the xaml and make sure that progress bar is not under any other control or out of the bound of screen. 我将检查xaml,并确保进度条不在任何其他控件之下或不在屏幕范围内。 As I can see that your progress bar Grid.Row is 5 and top is set to 209. it might be the case that it is out of the bound of the screen. 如我所见,进度条Grid.Row为5,top设置为209。它可能超出了屏幕范围。

  2. there might another piece of cod that is setting Intermediate state to false in the code file. 可能会有另一条鳕鱼在代码文件中将中间状态设置为false。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM