I programmatically place a bunch of images on my main page at startup. However I can't get the actualwidth and actualheight of the page until around 2-3 seconds after startup.
I have a mainpage in XAML called this:
Page Name="AnimalMainPage"
In the C# behind I'll then do some maths operations like this:
xLocation = (AnimalMainPage.ActualWidth) * xRandom;
However I get null for the actualwidth until some unknown time afterwards. Is there a way to get the actualwidth and actualheight of the device at startup so that I can populate the screen without having to wait some time to populate the screen?
The issue I have is that to reliably wait long enough to make sure that the app doesn't crash I am waiting 3 seconds, sometimes this is okay, but at othertimes the splash screen has already disappeared and the objects are populating on the screen after the
UI is visible to the user.
Thanks for your help