ProgressDialog not working in ArcGIS Pro 2.7

1333
2
Jump to solution
04-22-2021 11:01 AM
Labels (1)
TomLiu
by
New Contributor II

Hello ESRI Community,

Please help advise how to fix the issue. Currently I am using ArcGIS Pro 2.7. I am developing add-in button which tries to open ProgressDialog. I am using the following sample code from GitHub.

using (var progress = new ProgressDialog("Showing Progress", "Canceled", 100, false))
{
var status = new CancelableProgressorSource(progress);
status.Max = 100;
progress.Show();

await QueuedTask.Run(async () =>
{
for (var idx = 0; idx < 10; idx++)
{
await Task.Delay(1000);
status.Progressor.Value += 10;
status.Progressor.Status = (status.Progressor.Value * 100 / status.Progressor.Max) + @" % Completed";
status.Progressor.Message = "Message " + status.Progressor.Value;
}
}, status.Progressor);

progress.Hide();
}

For some reason, the ProgressDialog doesn't show up. The ProgressDialog was working fine in 2.6, but not in 2.7. Please advise how I can resolve this issue, because we're upgrading to 2.7 now and can't downgrade to 2.6. Thanks!

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Have you test it in debug mode? ProgressDialog does not show in Debug mode.

https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-text-of-progressdialog/td-p/858... 

https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Framework/ProgressDialog/Progre... 

3. Run ArcGIS Pro without running the Visual Studio Debugger.

4. Progress Dialog boxes are disabled when debugging in Visual Studio.

View solution in original post

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Have you test it in debug mode? ProgressDialog does not show in Debug mode.

https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-text-of-progressdialog/td-p/858... 

https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Framework/ProgressDialog/Progre... 

3. Run ArcGIS Pro without running the Visual Studio Debugger.

4. Progress Dialog boxes are disabled when debugging in Visual Studio.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

@GKmieliauskas  is correct ProgressDialog does not show up in Debug mode.  I tried your snippet in 2.7 and it worked, however, the 'await Task.Delay(1000)' didn't delay for me by 1 second as I expected.  Instead I used System.Threading.Thread.Sleep(1000), which did the job.

0 Kudos