Issue 'NavGraph cannot be null' with FreshMasterDetailNavigationContainer since MAUI 8
Opened this issue · 0 comments
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.