Skip to content

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

@PenseeNumerique

Description

@PenseeNumerique

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.

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