Forum Xamarin.Forms

Navigate to page after async task completed

Hi! I've got a problem. When I trying to go to another page from Task.ContinueWith(() => { //And here i'm navigating } that's not works
Navigation works sometimes if I move navigation line from ContinueWith block, but in that case program behavior is unacceptable.
So, how to implement navigation after task completion?
Here is some code
async void FromCameraButtonClicked (object sender, EventArgs e) { //Navigate to camera await AppLogic.TakePhotoFromCamera ().ContinueWith(async (t) => { if (t.Result == true) { var page = new EditPage(); this.Navigation.PushModalAsync(page); } }); //nav string here works }

Best Answers


  • adamkemp. thank you very mauch! Now works as it should.

Sign In or Register to comment.