Lukas KUCHTA
Lukas KUCHTA

Reputation: 13

MAUI Shell navigation - nav stack replace and query parameters for each item of stack

we have a MAUI app and in some case i need to replace whole stack of navigation with data for each page. But it seems that only last element can get data from query. For example:

await Shell.Current.GoToAsync("//A/B/c/Detail?id=1");

But i need data for each of page A,B,C for case when i go back by ..

How can i achieve this?

Something like this //A?id=2/B?id=3?.... or pass data when i make back button ..?id=20

Thanks for advice.

Upvotes: 0

Views: 972

Answers (1)

Jianwei Sun - MSFT
Jianwei Sun - MSFT

Reputation: 4312

Unfortunately, as you said that "only last element can get data from query". I created a project to try to achieve what you want but failed.

You can refer to the official doc about syntax of Passing data when use Shell navigate.

In addition, you can check this QuickStart by official. It also involves navigating with query parameter:

await Shell.Current.GoToAsync($"{nameof(NoteEntryPage)}?{nameof(NoteEntryPage.ItemId)}={note.ID.ToString()}");

Wish it could be helpful to you.

Upvotes: -1

Related Questions