I’ll preface this by saying that I’ve looked at the example projects, the video, and the older video on this subject. I’ve decided to use the Task Class method of updating a progress bar window. However, I’m having issues with it. I think the best way for me to explain what I’m doing is to walk through the flow:
[code]* User presses Start button on Main Window, chooses a folderitem
** folderitem is put in a global property (App.TheFolder)
** the Progress Bar window is opened (UIProgressWindow.Show)
** UIProgressWindow.Task1.Run is called from Start button
*** UIProgressWindow.Task1.run calls a method in the main window,
which iterates through App.TheFolder recursively, generating a list of files to process.
*** As this is running, it adds key/value pairs to a dictionary at certain
steps, which it passes to UIProgressWindow.Task1.UpdateUI
- Code in the start button initiates the processing of files once the list is finished
The slowest part of the code is in iterating through the folder, as some of the subfolders could contain 100k or more files. In a typical setup, there could be a 15-30 second delay, based on my testing. So I want a progress bar to at least indicate that something is happening, and ideally to show the file it’s currently looking at.
The problem I’m having is that even though the progress bar window is called up before the processing begins, the progress bar itself doesn’t appear until after the most time consuming task is complete, and then it just shows a full progress bar and the name of the last file in the set that it processed. Not particularly helpful to the user.
I must be missing something obvious here, because I’m doing all the stuff outlined in the documentation and the videos:
-putting the code that does the work inside the thread (via a method called from Thread.Run)
-Using Thread.UpdateUI to refresh the progress bar from within that same method
Is there something else that I’m not doing right in the basic setup?