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

Issue 'NavGraph cannot be null' with FreshMasterDetailNavigationContainer since MAUI 8 #338

Open
PenseeNumerique opened this issue Oct 28, 2023 · 1 comment

Comments

@PenseeNumerique
Copy link

Hello everyone,

I recently encountered an issue after updating my application to MAUI 8. Specifically, using FreshMasterDetailNavigationContainer triggers an error "NavGraph cannot be null".

Upon inspecting the code, I identified that the problem originates from the following lines in the CreateMenuPage method of FreshMasterDetailNavigationContainer:

var navPage = new NavigationPage(_menuPage) { Title = "Menu" };

if (!string.IsNullOrEmpty(menuIcon))
{
    navPage.IconImageSource = menuIcon;
}

Flyout = navPage;

By replacing these lines with:

Flyout = _menuPage;

The issue seems to be resolved, and the error no longer appears.

Do you think this is a good way to fix the problem? Or was it necessary before MAUI 8 for Flyout to be a NavigationPage?

PS: For those who need to make this correction while the package is not yet fixed, I recommend creating a CustomImplementedNav that replicates the code of FreshMasterDetailNavigationContainer and fixing the error. Afterwards, use your CustomImplementedNav in the App.xaml.cs file.

Thank you in advance for your advice and suggestions.

@spuliy
Copy link

spuliy commented Oct 23, 2024

I still have the same issue, any updates to this?

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

2 participants