Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PushPageModel does not work after the app ran in the background #333

Open
DSlutter opened this issue Jun 29, 2022 · 0 comments
Open

PushPageModel does not work after the app ran in the background #333

DSlutter opened this issue Jun 29, 2022 · 0 comments

Comments

@DSlutter
Copy link

When debugging Android I came across this issue when switching to a different app, pulling the app back from the background and trying to open a Page with PushPageModel through a FreshAwaitCommand. Only the constructor of the PageModel gets called when calling PushPageModel. After that nothing happens. I'm calling PushPageModel from a switch statement and it does not matter which PageModel i'm trying to open.

Here is a short version of the code used to open a page.

Command

PushPageCommand = new FreshAwaitCommand(async (obj) =>
{
    if (this.morePageItem?.Title != null)
    {
        await this.PushModel(this.morePageItem.Title);
    }
    obj.SetResult(true);
});

Switch

private async Task PushModel(string title)
    {
        switch (title)
        {
            case AboutTitle
                await CoreMethods.PushPageModel<AboutPageModel>();
                break;
            case SettingsTitle:
                await CoreMethods.PushPageModel<SettingsPageModel>();
                break;
            case LogoutTitle:
                await api.Logout();
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant