/// <summary> /// Event handler that is called when the user clicks the 'Get Projects' button in the UI. /// We'll spawn a background thread which will fetch the list of projects the user has /// access to from JIRA. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void settingsUiControl_OnGetProjects(object sender, GetProjectsEventArgs e) { this.JiraSettings.IsBusy = true; this.JiraSettings.SelectedProject = null; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate(object sender2, DoWorkEventArgs e2) { WorkerMethod(); }; worker.RunWorkerCompleted += delegate(object sender2, RunWorkerCompletedEventArgs e2) { this.JiraSettings.IsBusy = false; }; worker.RunWorkerAsync(); }