Closed LSXAxeller closed 6 months ago
Is it platform specific ?
I had something similar on android one day but never on desktop.
Is it platform specific ?
I had something similar on android one day but never on desktop.
it's on windows only.
I just tested on android and got this and and debugging stops while trying to load the HomeScreen from LoginScreen without the 3 seconds delay
System.Exception
Message=You are trying to use a InteractiveContainer functionality without declaring one !
and with the 3 seconds delay I just get a blank page
I have tested with your code
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
Loaded += OnLoaded;
}
private void OnLoaded(object? sender,RoutedEventArgs e)
{
_ = NavigationService.Navigate<MenuControl>(true, 0);
}
}
public static class NavigationService
{
public static async Task<bool> Navigate<T>(bool preventBack = false, double delay = 0) where T : UserControl, new()
{
await Task.Delay((int)(delay * 1000));
UserControl page = new T();
MobileNavigation.Push(page, preventBack);
return true;
}
}
But I can't reproduce the bug at all on windows, neither on android emulator. However I know that this problem happened few times on my real android device so I know there is something to find.
I update the nuget package to 11.1 beta, maybe it did something actually. I will retry later when I will be able to debug with my android device.
Maybe it's a problem on my end. I've also encountered issues with MAUI navigation. In the end, I switched to Flutter.
When my app launches and I try to navigate to a page from the MainView, I get a blank page. I am using an empty
<controls:InteractiveContainer />
in the MainView and loading from the code-behindOnLoaded
.Code:
Even if I use
inside MainView and try to load another page from LoginScreen, I get an error:
on
MobileNavigation.Push(page, preventBack);
from NavigationService with details:But it navigates to HomeScreen only after 3 seconds if I put a delay of 3, but not less.
NavigationService.Navigate<HomeScreen>(true, 3);
else it shows a blank page.