The default progress bar in Windows 8 also keeps pace with the times, different from the previous in Silverlight. This article describes three different progress bars. In addition, this article also describes two timers.
ProgressEntries
Main attributes:
Value: The current progress value.
Maximum: maximum progress value.
Isindeterminate: Specifies whether the progress bar is determined.
Confirm progress bar: Progress bar with clear progress. The progress is displayed in another color.
Key code:
<ProgressBar Maximum="100" Value="0" Height="20" Name="probar1" IsIndeterminate="False" Margin="275,167,966,581"></ProgressBar>
Uncertain progress bar: Progress bar with unclear progress, unpredictable current progress
Key code:
<ProgressBar IsIndeterminate="True" Width="80" Height="10" Margin="600,167,566,591"/>
Uncertain progress Ring: Progress ring with unclear progress; unpredictable current progress
Key code:
<ProgressRing IsActive="True" Height="58" Margin="1000,167,299,543" Width="67"/>
Timer
Latency Timer: A timer with a latency of X milliseconds.
Key code:
Private void button_click_1 (Object sender, routedeventargs e) {delaytimer () ;}/// <summary> /// delay timer /// </Summary> private void delaytimer () {// set the delay timer threadpooltimer tptimer = threadpooltimer. createtimer (async (timer) =>{ await dispatcher. runasync (coredispatcherpriority. high, () => {This. probar1.value + = 20;}) ;}, timespan. frommilliseconds (3000 ));}
Cyclic Timer: A timer that runs cyclically for n times with a latency of X milliseconds.
Key code:
Private void button_click_2 (Object sender, routedeventargs e) {periodictimer () ;}/// <summary >/// cyclic timer /// </Summary> private void periodictimer () {// loop timer threadpooltimer tptimer = threadpooltimer. createperiodictimer (async (timer) => {await dispatcher. runasync (coredispatcherpriority. high, () => {This. probar1.value = This. probar1.value + 1 ;}) ;}, timespan. frommilliseconds (100 ));}
Click win8progress.rar to download the runtime and desired source code.