Skip to content

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

Open
@DSlutter

Description

@DSlutter

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();
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions