This method or property must be called within the lambda passed to QueuedTask.Run.
Remarks
Certain Items must be refreshed on the MCT. Use IsMainThreadRequired to check. A true return value means the item must be refreshed on the MCT using QueuedTask.Run. SDE Items, for example, must be refreshed on the MCT. A false return value means the Item can be refreshed on any thread, including the UI, although using ArcGIS.Core.Threading.Tasks.BackgroundTask is preferred. Calling Refresh on the wrong thread for items where IsMainThreadRequired returns true will throw a ArcGIS.Core.CalledOnWrongThreadException.
Requirements
Target Platforms: Windows 11, Windows 10, Windows 8.1