Anyone have example C# using QueuedTask.UIScheduler? I have a lot of code that is running in worker thread using QueuedTask.Run but need to somehow dispatch a call to update the gui in the middle of it all. Any examples using UIScheduler or C# .Net would be great.
Hi Arwen,
Maybe somebody in the ArcGIS Pro SDK group could help...
Arwen,
You can use BeginInvoke to execute on the UI thread.
private void onLayersAddRem(LayerEventsArgs obj)
{
//regenerate snaplist when layers are added or removed
//run on UI Thread to sync layersadded event (which runs on background)
System.Windows.Application.Current.Dispatcher.BeginInvoke((Action)(() => { PopulateSnapList(); }));
}
In this example I am updating a datagrid in a dockpane from the background thread.