.Net Maui Windows: Is there a way to navigate directly to a page on the navigation stack?
I have a .Net Maui application targeting the Windows platform (net7) using Visual Studio 17.6.2.
All the routes are registered and throughout the entire application I use Shell navigation, e.g.
...
Routing.RegisterRoute(nameof(MatchListPage), typeof(MatchListPage));
Routing.RegisterRoute(nameof(MatchAddEditPage), typeof(MatchAddEditPage));
Routing.RegisterRoute(nameof(PlayersListPage), typeof(PlayersListPage));
Routing.RegisterRoute(nameof(PlayerAddEditPage), typeof(PlayerAddEditPage));
...
await Shell.Current.GoToAsync(nameof(MatchListPage));
...
await Shell.Current.GoToAsync(nameof(MatchAddEditPage), true,
new Dictionary<string, object>
{
{ "Match", new MatchViewModel() }
});
...
await Shell.Current.GoToAsync(nameof(PlayersListPage));
...
await Shell.Current.GoToAsync($"{nameof(PlayerAddEditPage)}?id=0");
An example of the current navigation problem:
Step 1. I click the menu item to navigate to the "PlayersListPage" page, which works fine.
Step 2. I click the menu item to navigate to the "PlayerAddEditPage" page, which works fine.
Step 3. I click the menu item to navigate to the "MatchListPage" page. However, the application goes to the "PlayersListPage" page instead of going to the "MatchListPage" page.
Step 4: I again click menu item to navigate to the "MatchListPage" page. The application now goes to the "MatchListPage" page.
My challenge is, how do I navigate directly to a page on the navigation stack?
Any help or advice will be appreciated. Thanks!