Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: BusyIndicator Not Visible

$
0
0
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 ?
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" );
}

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>