Hi, I have a question about FreshMvvm navigation:
How do I put a TabbedPage in Detail of MasterDetailPage using FreshMvvm?
I can't figure out how to do that with AddPage() that takes a FreshMvvmPageModel as a parameter.
I made a PageModel to the TabbedPage but it gives me error when lauching
Thanks in advance
@BrunoFreitas.2621
I used the FreshNavigationContainer and the FreshTabbedNavigationContainer for the Detail. Instead of setting the current page of the _tabbedNavigationPage set the Detail to the container you want.
Answers
@MichaelRidland
@BrunoFreitas.2621 in this case you might need to create a custom navigation service. If you take a look in the sample project on the GitHub repository there's a example of a custom navigation service.
@MichaelRidland Yes I studied the example, but I still dont understand how I'm going to add the page to the menu via AddPage() because it's necessary to pass a PageModel. Should I do 3 PageModels like this?
1) TabbedPageModel -> TabbedPage
2) FirstContentTabbedPageModel -> FirstTabPage
3) SecondContentTabbbedPageModel -> SecondTabPage
and pass the first one to the AddPage method and then that PageModel has the child instances?
Is this what's your looking for?
https://github.com/rid00z/FreshMvvm/blob/master/samples/FreshMvvmSampleApp/FreshMvvmSampleApp/Navigation/CustomImplementedNav.cs
@MichaelRidland Unfortunately no because I want to have a single option (among others that are simple NavigationPages) in the detail page that leads me a to TabbedPage with 2 different tabs, and I don't want to have the 2 options in both the menu and the TabbedPage.
Sorry, I don't know if I'm explaining well, English is not my native language. But thanks in advance!
@BrunoFreitas.2621
I got this working by modifying the CustomImplementedNav.cs from the example MichaelRidland provided. I did it by creating a Navigation Container for each page to be displayed in the Detail.
@NathanBarrios Did you used the FreshMasterDetailNavigationContainer and FreshTabbedNavigationContainer ?
@BrunoFreitas.2621
I used the FreshNavigationContainer and the FreshTabbedNavigationContainer for the Detail. Instead of setting the current page of the _tabbedNavigationPage set the Detail to the container you want.