gkmieliauskas_cellexp

ArcGIS Pro samples RunOnUiThread method

Discussion created by gkmieliauskas_cellexp on Jul 27, 2017
Latest reply on Jul 27, 2017 by gkmieliauskas_cellexp

Hi,

Some ArcGIS Pro samples ( Framework\DockPaneBookmarkAdvanced or Framework\DockpaneSimple) have Utils class with different implementations of RunOnUiThread and IsOnUiThread methods. I thought that it could be useful when you call some methods which must be called on MCT from different places. Sometimes you are on MCT, sometimes not. I have tried methods from both projects, but I failed. IsOnUiThread always said that code is on UI thread, but really it was not. So I started investigate why sample code works, but my not. I have looked at the methods which were used with RunOnUiThread and found that all of them use QueuedTask.Run inside. I have commented QueuedTask.Run and samples failed too.

Maybe I didn't understood the working RunOnUiThread functionality or it is bug?

Outcomes