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

PopModalAsync .... is it broken ????

$
0
0

Hi all,

It appears as if PopModalAsync is broken in this case
I am using a TabbedPage as my apps first/main page (say PrimaryTabbedPage)
I push and pop a modal Splash Screen here .
Upon some user action I call PushModalAsyc to push another TabbedPage (say SecondaryTabbedPage)
Upon Some user action on SecondaryTabbedPage I call PushModalAsyc to push view some page (say DescriptionPage)

Now when I call PopModalAsyn from DescriptionPage, I land up back in PrimaryTabbedPage ..... which is not expected
What I expect to be is to land in SecondaryTabbedPage

Here is a code snippet to help explain the problem

App Starts ---->

public static Page GetMainPage ()
                    {   
                        return new PrimaryTabbedPage ();
                    }

Create PrimaryTabbedPage pages ----->

        public class PrimaryTabbedPage : TabbedPage
            {

                    //Push the SplashScreen
                    Navigation.PushModalAsync (new SplashScreen ());

                    //Do something
                    Children.Add (new NavigationPage(new PrimaryTabbedPage1());
                    Children.Add (new NavigationPage(new PrimaryTabbedPage2());

                    //Pop the SplashScreen  
                    Navigation.PopModalAsync ();
        }

Some user action in PrimaryTabbedPages --- >

            public class PrimaryTabbedPage1 : ContentPage
                {
                    //On some user action
                    Navigation.PushModalAsync(new SecondaryTabbedPage());
                }   

Create SecondaryTabbedPage pages ---->

                public class SecondaryTabbedPage : TabbedPage
                    {
.....
                        Children.Add (new NavigationPage(new SecondaryTabbedPage1());
                        Children.Add (new NavigationPage(new SecondaryTabbedPage2());
                    }

On some user action in SecondaryTabbedPages --->

                public class SecondaryTabbedPage1 : ContentPage
                {
.....
                        Navigation.PushModalAsync(new DescriptionPage());
                }

On some user action on DescriptionPage --->

                public class DescriptionPage : ContentPage
                {
....
                        Navigation.PopModalAsync();
                }

I land up in PrimaryTabbedPage ... I expect to be in SecondaryTabbedPage


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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