Hi,
Is it possible to update Windows Form objects (ie. TextBox, ComboBox, etc) while in a QueuedTask? I keep getting the "wrong thread" exception error.
What I am doing is working with a selected feature, to populate fields on a form. Is there a recommended way of dealing with this?
Thanks,
Solved! Go to Solution.
Hi Brian,
You have to make any updates to the UI from the UI thread. There is a sample utility function in this community sample called RunOnUIThread that allows you to switch threads and run an Action on the UI thread. arcgis-pro-sdk-community-samples/BookmarkDockpaneViewModel.cs at 44183d0d5a9bc5da6fb8b9229211cc707dd...
Depending on your use case you can also use the Dispatcher class as shown here:
You mentioned 'Windows Form' objects which would exclude the use of synchronization patterns that are exclusive to WPF like BindingOperations.EnableCollectionSynchronization
Hi Brian,
You have to make any updates to the UI from the UI thread. There is a sample utility function in this community sample called RunOnUIThread that allows you to switch threads and run an Action on the UI thread. arcgis-pro-sdk-community-samples/BookmarkDockpaneViewModel.cs at 44183d0d5a9bc5da6fb8b9229211cc707dd...
Depending on your use case you can also use the Dispatcher class as shown here:
You mentioned 'Windows Form' objects which would exclude the use of synchronization patterns that are exclusive to WPF like BindingOperations.EnableCollectionSynchronization
Thanks Wolfgang. I'll check out those links.