Hello,
I have created a demo app where a button fires a toggle control, and to my surprise (or to my misunderstanding) the toggle OnChange event is running twice instead of once.
So I have:
- a variable named tmpcounter that OnStart of the App is set to 0
- a toggle control which its default value is based on a boolean variable (tmptoggleflag). This variable is initially set to false on the OnStart App event
- a button that, OnSelect, sets the boolean variable tmptoggleflag to true, to trigger the toogle
- the toggle OnChange event sets the boolean variable tmptoggleflag to false and increases the counter tmpcounter +1
When I run the sample application, every time I click the button, the counter tmpcounter is increased by 2, not by 1, so it looks like the OnChange event of the toggle is firing twice instead of once.
How/why is that possible ? What am I missing ?
Shouldn't the counter increase only by 1 ? Or what should I do so the toggle OnChange event is only fired once ?