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

Push/Pop pushmodalasync/popmodalasync

$
0
0

I know this has been discussed, but please bare with me....

I'm using Xamarin.Forms.

I have a TabbedPage application with 1 ContentPage at the moment, we'll call this "Root". It's the default screen that comes up. "Root" is in charge of pushing/popping different Content Pages when appropriate (think a login page over top "Root"). When my Login ContentPage is attempting a login, it tells Root to authenticate, which pops the login page and pushes a connecting page... then it will ultimately pop the connecting page and push a success page or push the login page again if validation fails.

I read that the ContentPages should not be pushing/popping themselves, which is why the logic is in Root which is always around.

Problem though, Android device works great. iOS seems to have a problem with those async functions to pop and push other pages. I keep getting errors telling me its popping a page that isn't done presenting, etc. I can put in long waits that get around the issue, but between the pages popping and pushing, I see Root flash for a split second because I have to wait for things to happen (Annoying).

So, what am I doing wrong?

Here's an example of a pop and push:

async public void PopAndPushError(string msg)
        {
        for(int i = 0;i < Navigation.ModalStack.Count-1;i++)
                await Navigation.PopModalAsync (false);

        await Navigation.PushModalAsync (new Error(msg), false);
        }

Viewing all articles
Browse latest Browse all 77050

Trending Articles



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