I’m using a progress bar for loading an image in an application for Windows Phone 7.
bitmapImage.DownloadProgress += new EventHandler<DownloadProgressEventArgs (bitmapImage_DownloadProgress);
void bitmapImage_DownloadProgress(object sender, DownloadProgressEventArgs e)
{
progressBar.Value = e.Progress;
}
XAML file:
<ProgressBar x:Name="progressBar" IsIndeterminate="True" Width="300" Height="30" Style="{StaticResource PerformanceProgressBar}" />
I’d like to know the best way to make the progress bar disappear once the image is loaded.
Use the events
ImageOpenedwhich triggers when image has been loaded successfully andImageFailedwhich triggers if image failed to download.