I'm trying to do something very simple like below.
UpdateUI()
{
DisableButtons()
LongRunningOperation_UpdateLotsOfInformation()
EnableButtons()
}
When I do a UI update, I want to disable the buttons while the UI is loading. However, when I run this code the message for DisableButtons() doesn't seem to be processed until all of UpdateUI() completes. The effect is that the buttons remain enabled for the duration of loading (may be 1 minute) then when the long running loading completes the buttons quickly flicker from enabled to disabled.
How do I make sure the buttons are disabled before processing the long running operation?
Any help would be greatly appreciated, thank you.