Here again an example complete with project.
What I do not understand is why the event pnlRoot_Resize is always executed twice.
In this example, it becomes clear that if the Sleep function is used, then many more entries are added than it should be.
However, if the sleep function is deactivated, then almost all will be ok, unless the event pnlRoot_Resize is executed twice anyway.
How can you solve the problem?
Or am I basically doing something wrong?
In this example, of course, no sleep is needed because the entries are added very quickly, but in my case it is necessary to make the ShowProgressBar function visible.
Here are the logs:
iPhone 6+5 (Show.page1):
Application_Start
iPhone 6+5 (Show.page1):
pMain_Resize
pnlRoot_Resize Width = 736
pnlRoot_Resize Width = 736
Application_Active
iPhone 6+5 (Show.page2):
pPage2_Resize
pnlRoot_Resize Width = 736
Item 0
Item 1
pnlRoot_Resize Width = 736
Item 0
Item 2
Item 1
Item 3
Item 2
Item 4
Item 3
Item 5
Item 4
Item 6
Item 5
Item 7
Item 6
Item 8
Item 7
Item 9
Item 8
Item 10
Item 9
ColorAllPanel
Item 10
ColorAllPanel
#############################################
iPhone X (Show.page1):
Application_Start
Application_Active
pMain_Resize
pnlRoot_Resize Width = 812
pnlRoot_Resize Width = 724
***********************
iPhone X (Show.page2):
pPage2_Resize
pnlRoot_Resize Width = 812
Item 0
Item 1
pnlRoot_Resize Width = 724
Item 0
Item 2
Item 1
Item 3
Item 2
Item 4
Item 3
Item 5
Item 4
Item 6
Item 5
Item 7
Item 6
Item 8
Item 7
Item 9
Item 8
Item 10
Item 9
ColorAllPanel
Item 10
ColorAllPanel