C#C
C#2y ago
CG Seb

MAUI Popup at first start

Hi everyone,

I created a MAUI app for windows (later mac), I would like to show a GCU popup at the first launch of the app. I tried to use the OnAppearing() of my Home page, but since it's not an async method, it doesn't wait for my popup. The popup only show if I go to another page and then go back to the home page 😦

C#
protected override void OnAppearing()
{
    bool GCUAccepted = Preferences.Get(Constants.GCU_ACCEPTED_KEY, false);
    if (!GCUAccepted)
    {
        GCUPopupPage page = new();
        popupNavigation.PushAsync(page);
    }

    viewModel.LoadRecentsCommand.Execute("");
    viewModel.LoadFavoritesCommand.Execute("");
    base.OnAppearing();
}


Do you guys have any Idea on how to do this please?
Was this page helpful?