ArticleDirectory
The following is from msdn: http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/gg442303 (V = vs.105). aspx
Below Code Set the isindeterminate flag True So when you run this example, the progress bar is displayed immediately. To add a progress bar in the XAML code, use the following code: XAML <progressbar isindeterminate =" True "X: Name =" Customindeterminateprogressbar "Style =" {Staticresource customindeterminateprogressbar} "/> Add the above Code to the <grid> tag of mainpage. XAML. The contentpanel of this tag is X: Name. When using a progress bar in your application, make sure that the progress bar is set to isindeterminate = False When the progress bar is not used, the visibility attribute is set to collapsed. For demonstration, this example sets Program To complete the operation. Alternatively, if you do not want to set or switch these values, you can set to use data binding on isindeterminate. For the purpose of this example (using a button to switch values), add the following code to mainpage. XAML and put it directly below the progressbar code in the previous step: XAML <button content =" Toggle progressbar "Height =" 72 "Horizontalalignment =" Left "Margin =" 81,450, 0, 0 "Name =" Togglebutton "Verticalalignment =" Top "Width =" 300 "Click =" Togglebutton_click "/> In the click handler, use the following code to switch values: C # customindeterminateprogressbar. isindeterminate =! (Customindeterminateprogressbar. isindeterminate ); If (Customindeterminateprogressbar. Visibility = visibility. Collapsed) {customindeterminateprogressbar. Visibility = visibility. visible ;} Else {Customindeterminateprogressbar. Visibility = visibility. collapsed ;}
Main Code
: Start isindeterminate = "true" and set the progress control to display status
Customindeterminateprogressbar. Visibility = visibility. visible;
End with isindeterminate = "false" and set the progress control to hidden.
Customindeterminateprogressbar. Visibility = visibility. collapsed;