Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Cancel Navigation while async Task is still running

HarryLobsterHarryLobster Member ✭✭✭

Inside my App I post some Data with REST-Api to my Server. That can take up to some seconds and could fail. These Tasks are all async. While these Tasks are running I want to prevent the User from closing the current Page or switching to another Tab when I am Using a TabbedPage. I am using Prism but I can only cancel Navigation when I am using GoBackAsync() and that is not enough. Any Ideas on this matter ?

Best Answer

Answers

  • HarryLobsterHarryLobster Member ✭✭✭

    @LandLu said:
    Try to display a dialog to disable the user interaction:
    https://github.com/aritchie/userdialogs
    Therefore, the user can't click the back button or tabs when the dialog is displaying.

    Thanks for the tip. I thought of a different solution, but exactly this suggestion fitted well to my app. Case closed !

Sign In or Register to comment.