You can easily test all standard methods. It took me less time than writing this text to do this.
In the page constructor:
Loaded += new RoutedEventHandler(TestPage_Loaded);
LayoutUpdated += new EventHandler(TestPage_LayoutUpdated);
Relevant methods:
void TestPage_LayoutUpdated(object sender, EventArgs e)
{
Debug.WriteLine("LayoutUpdated");
}
void TestPage_Loaded(object sender, RoutedEventArgs e)
{
Debug.WriteLine("Loaded");
Dispatcher.BeginInvoke(() =>
{
Debug.WriteLine("Loaded -> BeginInvoke");
});
}
Add a debug entry to OnNavigateTo ().
If your page is similar to complex than mine, then you get something like:
- OnNavigatedTo
- Layoutupdated
- Loaded
- Layoutupdated
- Uploaded → BeginInvoke
- many times LayoutUpdated
The last LayoutUpdated will be the best candidate, but how to find it? Therefore, "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. It is also trivially easy. They probably occur between the 4th and 5th steps.
( ), . , , . LayoutUpdated.