I have read your article on how to use the BusyIndicator, but I am still having an issue. The BusyIndicator is not visible until after my LRP finshes. My CopyFiles() method touches some of the UI elements. I would like to be able to show the BusyIndicator while my copyFiles() method runs and then have it go away when the method completes. I would prefer to not have to use a "timer".
private void copyFiles_Click(object sender, RoutedEventArgs e)
{
BackgroundWorker worker = new BackgroundWorker();
//LRP
copyFiles();
worker.DoWork += (o, ea) =>
{
for (int i = 0; i < 100; i++)
{
System.Threading.Thread.Sleep(50);
}
};
worker.RunWorkerCompleted += (o, ea) =>
{
_busyIndicator.IsBusy = false;
};
_busyIndicator.IsBusy = true;
worker.RunWorkerAsync();
}