I'm implementing a Maui app using Shell navigation. I have a navigation hieararchy set up, I understand how to navigate from one page to the other using page routes.
However, I have a page that can be opened from multiple source pages, let's call this ItemDetailsPage. On multiple source pages, where I display items, whenever I tap an Item, I navigate to ItemDetailsPage. So far so good. To navigate to ItemDetailsPage I do Shell.Current.GoToAsync(state, animate, arguments). Note that I use the IQueryAttributable argument passing method to pass arguments.
BUT, when I tap the OK button on ItemDetailsPage, I want to navigate back to the source page (which can be a number of different sourfce pages). To do that I use Shell.Current.Navigation.PopAsync(). But the next page on the navigation stack is not the source page, where I came from, but the parent in the navigation hierarchy, as Shell navigation set it when I used GoToAsync() to navigate to ItemDetailsPage.
I could change the source => ItemDetailsPage navigation to use Shell.Current.Navigation.PushAsync(), but PushAsync doesn't support passing arguments (the IQueryAttributable way), so this way I couldn't pass any arguments.
Any chance PushAsync could support IQueryAttributable targets?
Is there some other way to put the source page on the navigation stack so that popping ItemDetailsPage would take me there?
My last resort is to fall back to some other argument passing method, but the rest of the app uses this pattern, so would be nice to stick to IQueryableAttribute's.