Hi,
Using your code, if you put the "copyFiles()" method Inside the "DoWork", the copy of the files will be done in background while the BusyIndicator will be shown. Have you tried this ?
Using your code, if you put the "copyFiles()" method Inside the "DoWork", the copy of the files will be done in background while the BusyIndicator will be shown. Have you tried this ?
private void Button_Click( object sender, RoutedEventArgs e )
{
BackgroundWorker worker = new BackgroundWorker();
_busyIndicator.IsBusy = true;
worker.DoWork += ( o, ea ) =>
{
//LRP
this.CopyFiles();
};
worker.RunWorkerCompleted += ( o, ea ) =>
{
_busyIndicator.IsBusy = false;
};
worker.RunWorkerAsync();
}
private void CopyFiles()
{
System.Diagnostics.Debug.WriteLine("Start Copy");
for( int i = 0 ; i < int.MaxValue ; ++i )
{
int x = 0;
}
System.Diagnostics.Debug.WriteLine( "End Copy" );
}