I'm trying to enable a busy indicator on log in. The problem I'm having is it won't enable until everything is done executing. How can I immediately tell the thread to update the UI as soon as I log in to start the indicator asap?
private void LoginButton_Click(object sender, RoutedEventArgs e) { this.Dispatcher.Invoke((Action)(() => { radBusyIndicator.IsBusy = true; //var backgroundWorker = new System.ComponentModel.BackgroundWorker(); //backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(backgroundWorker_DoWork); //backgroundWorker.RunWorkerAsync(); })); string error = string.Empty; long userId = 0; //Login code here.... //........... bunch of other code. etc.. }