AnsweredAssumed Answered

Create a ProgressDialog with ProgressBar

Question asked by EternalDOOM on Jan 23, 2020
Latest reply on Jan 23, 2020 by wkaiser-esristaff

Hello,

 

I'm trying to create a progress dialog that shows a progress value from 0 to 100 %.

 

Doing some research I found out that ProgressDialog() with CancelableProgressorSource() is able to serve this. My current setting is as follows:

 

public async void ComponentChangedHandler(Component selectedComponent)
{
    using (var progress = new ProgressDialog("Start Work"))
    {
        var status = new CancelableProgressorSource(progress);
        status.Progressor.Max = 100;
        progress.Show();

        await QueuedTask.Run(() =>
        {
            uint step = 0;
            foreach (var dateRange in dateRanges)
            {
                DoSomeLongWork();
                step += 10;
                status.Progressor.Value = step;
            }
        }, status.Progressor);

        progress.Hide();
    }
}

 

This way I'm getting a nice progress dialog with my dialog message and a bar animation spinning from left to right and back again. What I want is a progress bar filling up from left to right increasing percent progress by 10 in each iteration step.

What am I missing here?

Outcomes