locked
How to avoid MessageDialog in Page Navigation RRS feed

  • Question

  • In my application hitting service call on every page navigation and showing MessageDialog to user.

    My problem was when I hitting service call (await) on page navigation "Page1" to "Page2" whereas service call taking certain time to complete meantime user taps back to "Page1"

    In that case user seeing "Page1" and await service call completed on "Page2" and showing that service response message in "Page1".

    How can I avoid MessageDialog suppose user navigates back from that page.
    Thursday, October 10, 2013 7:48 AM

All replies

  • If you need to wait for a function to finish before proceeding then write the function to return a Task and then await the Task.

    See Quickstart: Calling asynchronous APIs in  C# or Visual Basic for a good overview.

    Not quite relevant to your question, but you probably want to rethink your UI to reduce or eliminate the MessageDialogs.

    --Rob

    Thursday, October 10, 2013 8:13 AM
    Moderator