I feel silly, but I just can’t find an answer to this. Let’s say I want to show some message to the users when the MainPage loads. The problem is that if I do this on Loaded event (MessageBox.Show()), the popup shows just before my page is loaded which leaves the user with this message and a black background. This is kind of dull situation. Any ideas which event can do the trick. There other ways around like background worker or NavigationInTransition_EndTransition event but there should be more elegant way ?
Share
You can easily test all standard methods. It took me less time than writing this text to do so.
In page constructor:
Respective methods:
Add debug write to OnNavigateTo() as well.
If your page is similarly complex than mine, then you get something like:
Last LayoutUpdated would be the best candidate, but how would one detect it? Hence “Loaded -> BeginInvoke” seems to be the best option among the trivial ones.
You can also use the Loaded events of individual components on your page. That’s also trivially easy. They will probably happen sometimes between 4th and 5th step.
If none of above options helps (I don’t think so), you have to use non-standard logic. Such as above mentioned one-shot timer that shows the message after some time. Or base your logic on LayoutUpdated counter.