I am developing a 'Universal App' for Windows 8.1 and Windows Phone 8.1
I need to add a ProgressRing
control to my page, because there is a task which takes some time to complete and I should notify the user that the app is loading data. So I followed the instruction on MDSN in the following link:
To create an indeterminate progress ring and they stated what I exactly need:
4. Adding an indeterminate progress ring
When you can't estimate how much work remains to finish a task and the task does block user interaction, use an indeterminate progress ring. An indeterminate progress ring shows an animate sequence of dots moving in a circle.
The problem is that the ProgressRing
doesn't play the animation of "loading", when I insert prog.IsActive = true;
before the code that starts the task
If I comment the Task lines of code, it plays.
XAML :
<ProgressRing x:Name="prog" Margin="435,349,388,181" FontFamily="{StaticResource FontFamily6}" FontSize="25" />
C#:
private void LevelTap(object sender, TappedRoutedEventArgs e)
{
prog.IsActive = true;
CheckNav(sender);
}
private void CheckNav(object sender)
{
TextBlock tb = sender as TextBlock;
GameSetter game = new GameSetter();
game.Level = (int)TextDict[tb];
if (!LevelsArr[game.Level]) return;
if (!goToLeader)
{
prog.IsActive = false;
CallNav(true, game);
}
else
{
prog.IsActive = false;
CallNav(false, game);
}
}
private void CallNav(bool b,GameSetter g)
{
if(b) Frame.Navigate(typeof(Game8), g);
else Frame.Navigate(typeof(MainPage), g);
}
Note: The Task that runs uses Dictionary
, Windows.Storage.ApplicationData
, and Navigation
for another page in the end.