2
votes

May be because I am new to Prism and to Xamarin Froms because of which I am facing a basic issue with the navigation.

Let me start with the details of my implementation and then the issue at hand.

  1. I have a MasterDetail Page (named Home) which is my main page.
  2. There are a few menu items in the Master Page. One of them is Partner.
  3. On Click of Partner menu item, NavigationService.NavigateAsync("Navigation/Partner") method is called. Where "NavigationService" is of type "INavigationService".
  4. This opens a page called "Partner" which is a tabbed page (TabbedPage). The first tab is a contentpage called "PartnerAll".
  5. PartnerAll page contains a listview. On click of a list view item, a new page is opened "PartnerDetails" by calling NavigationService.NavigateAsync("Navigation/PartnerDetails", parameters, false, true);
  6. On PartnerDetails page there is a "Cancel" button. On click of this button, I call await NavigationService.GoBackAsync(null, false, true);

Issue: When I call GoBackAsync, nagivation does not happen to the PartnerAll tab of Partner page. PartnerDetails page remains open.

Where is it I am going wrong. What should I do to make it work?

Please assist.

Best regards, Ankur Jain

2

2 Answers

0
votes

The issue got resolved by following the suggestion provided in this question (a related question): Prism Xamarin Forms ToolbarItem appearing twice

0
votes

In point 5. you created new navigation page with new root page PartnerDetails and there is navigation stack with only one page, nothing to pop off.

Change:

PartnerAll page contains a listview. On click of a list view item, a new page is opened "PartnerDetails" by calling NavigationService.NavigateAsync("Navigation/PartnerDetails", parameters, false, true);

To:

PartnerAll page contains a listview. On click of a list view item, a new page is opened "PartnerDetails" by calling NavigationService.NavigateAsync("PartnerDetails", parameters, false, true);