My application has a complex layout, with nearly 300 elements (mainly panels and labels).
LoadLayout run time is about 1.6 seconds, during which, an empty activity is shown.
Are there any tips to speed up LoadLayout?
is there a way to check if a layout has already been loaded?
example:
let's suppose a kind of popup panel
the first time it's displayed, i should call LoadLayout before turning Visible to True
subsequent calls can skip the LoadLayout call and display the panel directly
if mainMenuLoaded=false then
mainMenu.loadLayout("mainmenu") 'load your layout (not sure if this is the right syntax as I generate by code)
mainMenuLoaded=true
end if
mainMenu.visible=true 'unhide if it was hidden by some menu selection
maybe you can tell without the variable by checking if the panel has childs.
Just an update for all who helped me on this.
I actually split up the big layout file in several smaller ones: one file for each panel.
Before showing a panel I check if the layout for it is already loaded, calling LoadLayout otherwise.
This sped up the initial startup of the app, spreading loading times over the whole lifecycle of the app.
Not all panels are always needed, and those who get loaded on demand, have very little delay, with no user impact.