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

New Post: BusyIndicator Not Visible

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

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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