Silverlight progress bar not updating

20-Oct-2017 06:29 by 2 Comments

Silverlight progress bar not updating - sexbioscoop dating

I'm having a problem with continuous refreshing of progress bar (increment a progress bar until is full and do it in loop).

We’ll get to the code behind class in a minute, but let’s get the XAML code right.The simple way to fix this is to simply do all the processing in the UI thread, but mostly that is not a practical solution.The proper way to deal with this situation is to dispatch the requested UI-related operation to the UI thread using the Dispatcher class.The only thing to note that initially the Cancel button and progress bar visibility is set to hidden.Here is the code where we launch the Do Work event operation, but more importantly we pass in data which the Do Work can use to perform its operations.The first thing we do is darken the button which launched the process so the user doesn’t click it twice.

Then we make the cancel button and the progress bar visible to the user as the process is about to begin.We get a numeric percentage which moves the bar along and incremental movements.The cancel is similar because we do the opposite of the initiation code above by hiding the controls and informing the user of the stop action.Notice, that the path figure and the arc segment got a name attached.These references are used in the code behind to update the arc segment (in a custom control template you will provide these references as a template part).Finally we extract data held in Gui controls exposed to the user.