Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Navigate to page after async task completed

$
0
0

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
        }

Viewing all articles
Browse latest Browse all 75885

Trending Articles