Click here to Skip to main content
15,881,813 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
WatingImage should be displayed in Center of the page while the data being processed.
Posted
Comments
Yannick Brodard 17-Jul-14 8:23am    
Display it before processing the data and remove it when data is processed. And if you don't want your application to freeze while your data is being processed, just use sync / await for you method
CodeChecker 5689 17-Jul-14 8:53am    
<grid>
<mediaelement x:name="MediaPlayer" mediaended="MediaPlayer_MediaEnded" unloadedbehavior="Manual" loadedbehavior="Manual" visibility="Collapsed"
="" height="81" horizontalalignment="Left" margin="199,108,0,0" verticalalignment="Top" width="91">
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="118,94,0,0" Name="button1" VerticalAlignment="Top" Width="75" KeyDown="button1_KeyDown" Click="button1_Click"/>



----------------

private void button1_Click(object sender, RoutedEventArgs e)
{
try
{
MediaPlayer_MediaEnded(sender, e);

System.Threading.Thread.Sleep(5000); // Added for testing purpose
}
finally
{

MediaPlayer.Stop();
MediaPlayer.Visibility = Visibility.Collapsed;
}
}

private void MediaPlayer_MediaEnded(object sender, RoutedEventArgs e)
{
MediaPlayer.Visibility = Visibility.Visible;
MediaPlayer.Source = new Uri(@"/Images/ABC_busy_animation.gif");
MediaPlayer.Position = new TimeSpan(0, 0, 2);
MediaPlayer.Play();
}
CodeChecker 5689 17-Jul-14 8:55am    
it won't work while thread is sleeping and finally it will collapsed without showing any effect.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900