The BookDetailsPage happens to have a long-running operation in its OnLoad event. It should not be a problem as the OnLoad event is marked as async and the long-running call is awaited. Regardless of that, the line of code

this.Frame.Navigate(typeof(BookDetailsPage), book.ID)

"freezes" the UI. For example, the title of the page does not change to "Testing...". The same is when I try to show a progress ring. It does not show up.

Why is that? How can I show an indication to the user that the next page is in the process of displaying?

Antworten

You'll need to give us more information about what you're doing in OnLoad if you want more help. If you wrote it such that you have a dependency on the loaded data then that could cause an apparent freeze even if the app is technically responsive. Check
that you have some basic Xaml to render before the data is ready. If the page is blank until the data is ready and bound then there won't be anything to show. If that's the case then you should be able to add a progress bar to run before waiting on your
data load. Again though, with no information about what your Xaml and code look like this may not be relevant to your situation.

Thanks Dave for your response. I have conducted some performance tests and they confirmed that the OnLoad event on the page B (the one I'm navigating to) takes time. This is what I expected. The question is not about performance - it is about responsiveness:
why can't I update UI before navigating to another page? I can't change the page title (just like in the sample code I included) or show a progress ring.

The link you gave me looked very promising. Unfortunately, the App I'm working on must support Windows 8 and the feature from the MSDN article refers to the LoggingChannel.LogMessage method which is available only on Win 8.1 :(

You'll need to give us more information about what you're doing in OnLoad if you want more help. If you wrote it such that you have a dependency on the loaded data then that could cause an apparent freeze even if the app is technically responsive. Check
that you have some basic Xaml to render before the data is ready. If the page is blank until the data is ready and bound then there won't be anything to show. If that's the case then you should be able to add a progress bar to run before waiting on your
data load. Again though, with no information about what your Xaml and code look like this may not be relevant to your situation.