Hello @Pelin Konaray ,
You add a number of ShellContent
for flname
and they all point to the FileSystemPage
, but you haven't set the unique Route
for each item. For more details, refer to .NET MAUI Shell navigation - .NET MAUI | Microsoft Learn
Routing.RegisterRoute("My Folder" + nameof(FileSystemPage), typeof(FileSystemPage));
Routing.RegisterRoute("Private Network Folder" + nameof(FileSystemPage), typeof(FileSystemPage));
Routing.RegisterRoute("Public Network Folder" + nameof(FileSystemPage), typeof(FileSystemPage));// register route for each detailed item
......
flname.Items.Add(new ShellContent() {Route = "My Folder", Title = "My Folder", Content = new FileSystemPage(new FileSystemPageViewModel() {...}) });//pay attention to setting the Title for ShellContent
flname.Items.Add(new ShellContent() { Route = "Private Network Folder", Title = "Private Network Folder", Content = new FileSystemPage(new FileSystemPageViewModel() { ... }) });
......
Tips: Please do the same for Team Folder
, My Shared
and so on.
Then you can replace the route
with the route registered above, they are all "Second" before. ( It also works if they push to "Second")
await Shell.Current.GoToAsync($"{Title}{nameof(FileSystemPage)}?Title= ...);
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.