How do you iterate a Progressor?

07-07-2016 08:42 AM
Occasional Contributor III

I want to show a progressor while I loop through the selected features and do stuff and let the user know how long it will take.  I can get the Progressor to display, but it only goes from left to right, then starts over at the left and continues this until it's done.  I set progressor.Max to the count of selected features and inside my loop (while cursor.MoveNext()) I do progressor.Value += 1, but I can't get it to start on the left and go to the right, stopping when value = max.

0 Kudos
2 Replies
by Esri Regular Contributor
Esri Regular Contributor

Hi Ted,

I you use the sample @ and make the update below in the "RunDialogButtonsCancel" class you will get the desired effect.  I will update the sample soon to reflect this capability.  The trick is to create your own ProgressDialog instance and specify the 'maximum steps' parameter.

protected override async void OnClick()

{   //If you run this in the DEBUGGER you will NOT see the dialog

      uint maxSteps = 5;

      var pd = new ArcGIS.Desktop.Framework.Threading.Tasks.ProgressDialog(

                "Doing my thing - cancelable", "Canceled", maxSteps, false);



                    new CancelableProgressorSource(pd), maxSteps);


by Esri Regular Contributor
Esri Regular Contributor

Hi Ted,

I updated the sample @ and added a progress dialog that iterates through a given number of steps as shown in my post above (see the for a screenshot of this functionality).