0

I am programming an app with .NET Maui and use Mopup Nuget package. A pop up window should be opened and from there a navigation page should be opened by a button. Unfortunately when clicking the button no navigation page appears. Only when I close the mopup window the navigation page is displayed. But if I close the pop-up window first, as I was told, the navigation page is not displayed. How can I solve this? Thank you very much



using Mopups.Services;
using Mopups.Pages;

namespace FinanceTracker.Pages;

public partial class ExpenseEntryWindow : PopupPage
{
    public ExpenseEntryWindow()
    {
        InitializeComponent(); 
    }

    private void btnAbbrechen_Clicked(System.Object sender, System.EventArgs e)
    {
        MopupService.Instance.PopAsync();    
    }


    private async void btnNavigation_Clicked(object sender, EventArgs e)
    {
        await Navigation.PushAsync(new NewPage1());
    }

}

1 Answer 1

0

Your method should invoke both the closure of the Mopup and the navigation

private async void btnNavigation_Clicked(object sender, EventArgs e)
{
    await MopupService.Instance.PopAsync();    
    await Application.Current.MainPage?.Navigation?.PushAsync(new NewPage1());
}

Let me know if you have any further queries

Sign up to request clarification or add additional context in comments.

2 Comments

Hey Ali. Thank you for the answer. The problem is when I close the mopup window i can not open the navigation page. Maybe because the navigation page start from the mopup. I dont know
You used the code I just gave you and it did not work?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.