I am making a quiz game and for this reason, whenever a question is asked i need a time based progress bar which will actually decrease. Time will be very short like 1-3 second. I need a solution, so that I can make a progressbar that will animate to zero based on time.
Thanks for your reply.
You can create an animation targeting the Value property of your ProgressBar.
Let's say you have added the ProgressBar as:
<ProgressBar x:Name="progress"/>
Then add the StoryBoard in page Resources as (set the Duration based on your requirement):
<phone:PhoneApplicationPage.Resources>
<Storyboard x:Name="sb">
<DoubleAnimation Storyboard.TargetName="progress"
Storyboard.TargetProperty="Value"
From="100" To="0" Duration="0:0:3"/>
</Storyboard>
</phone:PhoneApplicationPage.Resources>
Run the animation from code behind as:
sb.Begin();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With