0
votes

I have a MasterDetail page which in Xaml has defined a navigation menu as a master bit and just an empty Detail.

Once user logs in I navigate to the main page using the following path

await _navigationService.NavigateAsync(PageCodes.NavigateTo_MainMenuPage + "/" + PageCodes.NavigateTo_NavigationPage + "/" + PageCodes.NavigateTo_WelcomePage); 
  • NavigateTo_MainMenuPage is my MasterDetail Page
  • NavigateTo_NavigationPage an empty Navigation page
  • NavigateTo_WelcomePage my home page (content page)

This works perfectly, iOS shows both Navigation (master) and Welcome page (content page)

Master-detail all good

One of the options in the navigation is to go to About page (so user triggers this via MasterDetail.Master XAML)

I expected that this code

await _navigationService.NavigateAsync(PageCodes.NavigateTo_WebPage, param);

will replace the Detail bit of the MasterDetail Page but instead of that it opens it as a model page (full screen) and app loses the Hamburger menu. I even tried to add false, after param but it didn't work

Modal

This code

await _navigationService.NavigateAsync(PageCodes.NavigateTo_NavigationPage + "/" + PageCodes.NavigateTo_WebPage, param, false);

opens the page as a child of the main page (iOS shows back to welcome page) which I don't want.

Not good

I even tried this code

await _navigationService.NavigateAsync(PageCodes.NavigateTo_MainMenuPage + "/" + PageCodes.NavigateTo_NavigationPage + "/" + PageCodes.NavigateTo_WebPage, param, false);

but it shows NavigateTo_WebPage without Master page and as I can see the hamburger menu is missing

Hambuger is missing

Just to clarify all this code is happening in the view of MainMenuPage (MainMenuPageViewModel)

So My question is what I'm doing wrong and how to push with Prism new content to Detail bit of MasterDetail page

thanks in advance!!!

1

1 Answers

1
votes

I've managed to fix the problem. My Navigation page didn't have a ViewModel. Frankly, I thought as it's a dummy page without any logic I don't need the ViewModel.

As soon as I added the page, everything was fine