Select to view content in your preferred language

froozen UI

597
2
11-18-2022 06:28 AM
pspada_WT
Regular Contributor

Hi,

I'm using a ExecuteToolAsync for join one featureclass and a table. I need to wait for the result to understand if it is good/bad.

The problem is that waiting for the result cause the ui to freeze forever. It seems like the Task doesn't retrieve the result.

What I'm doing wrong?

 

pspada_WT_0-1668781541082.png

 

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

ExecuteToolAsync doesn't need QueuedTask.Run. You can use ExecuteToolAsync with CancelableProgressor.

Sample here:

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9385.html 

0 Kudos
FridjofSchmidt
Frequent Contributor

This might work:

private static async Task<bool> makeJoin(string rightTableName)
{
	var pathRight = Path.Combine(Project.Current.DefaultGeodatabasePath, rightTableName);
	var args = Geoprocessing.MakeValueArray(fcName, idField, pathRight, zoneField);
	var test2 = await Geoprocessing.ExecuteToolAsync("management.AddJoin", args);
	return !test2.IsFailed;
}