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

How to wait for a PopAsync after a PushAsync

$
0
0

Hello,

Page1 PushesAsync Page2.
When the user has finished with Page2, Page2 is PopedAsync.
How I can detect in the Page1 ViewModel that Page2 is PopedAsync?

This is the Page1 View Model code:

            SelectOnSkyViewCommand = new Command(() =>
                {
                    int selectedStar;
                    navigation.PushAsync(new SkyUrhoSurface(CurrentSight, navigation));
                    //Some code here to use the CurrentSight result after SkyUrhoSurface PopesAsync...
                });

This is the Page2.cs code:

        void OnButtonShootThisBodyClicked(object sender, EventArgs args)
        {
            if(skyUrho!=null)
                if(skyUrho.SelectedStar!=null)
                    this.currentSight.StarID = (int)skyUrho.SelectedStar;
            navigation.PopAsync();
        }

Thanks for reading.


Viewing all articles
Browse latest Browse all 89864


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>