Hello @Pelin Konaray ,
As described in .NET MAUI Shell navigation - .NET MAUI | Microsoft Learn, the routes in an app should be unique. You have set the route in ShellContent
:
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />
And you set the route again in AppShell.xaml.cs
, you could try to set a different route:
Routing.RegisterRoute("SecondMainPage", typeof(MainPage));// the different rout as you said" the template of the page is the same, but the pages different"
// Routing.RegisterRoute(nameof(MainPage), typeof(MainPage));
Then you can go to the next page :
await Shell.Current.GoToAsync("SecondMainPage");
Another way to achieve this, you don't have to register routes, try to find the navigation, then push a new page
await Shell.Current.Navigation.PushAsync(new MainPage());
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.