I'm using the IASToolkit to create an interactive UI for a low-code app. I want to disable the button on pressed to avoid people pushing it multiple times and to indicate that the action linked to the button is running. I was looking into triggering the Update method after setting the IsEnabled property, but that is only allowed in manual mode. I didn't find a lot of information on how the manual mode should be used. When running the script from the Automation application, everything seems to be disabled by default.
What is the easiest/best way to achieve this?
I've pushed an example to github: DisabledWhenPressed
The solution is to call Show(false); in your dialog class whenever you want the visuals to get updated, but haven't finished processing your event.
Note, by default, Show(); will use true as input, which means a response is required and prevents further Show calls from working.
With thanks to Thomas Cauwelier for explaining why the Show() wasn't working for me initially.
Would it be an option to do something like this?
private void OnPressed(object sender, EventArgs e)
Button.IsEnabled = false;
// Method body
Button.IsEnabled = true;
Setting the IsEnabled property to false causes the widget to be grayed out and disables user interaction.