private void OnProjectRetrievalCompleted(object sender, EventArgs args) { if (Application.Current != null && Application.Current.Dispatcher != null) { Application.Current.Dispatcher.Invoke(() => { ProjectRetrievalCompleted?.Invoke(this, EventArgs.Empty); }); } }
public Task RetrieveProjects() { return(Task.Run(() => { if (Application.Current != null && Application.Current.Dispatcher != null) { Application.Current.Dispatcher.Invoke(() => { ProjectRetrievalCompleted?.Invoke(this, EventArgs.Empty); }); } })); }