Mvvmcross: Xamarin Forms presenter doesn't allow Tabbed Pages in a MasterDetailPage Detail property for displaying tabs in a Detail section of Master Detail

Created on 13 Feb 2019  路  3Comments  路  Source: MvvmCross/MvvmCross

馃悰 Bug Report

In Xamarin Forms you can have a Master Detail page and in the detail section - you can display a tab page for Detail that allows navigation of said tabs. Currently the view presenter doesn't support this behavior due to the ShowTabbedPage in the presenter replacing the MasterDetail page when creates the TabbedPage.

Expected behavior

When drawing a Tabbed Page and Master Detail is displayed the tabbed page shows up in the Detail Page of the Master Detail.

Reproduction steps

Create a new Xamarin Forms project. Make Master Detail the root or first page. Create a standard page and set it to master. Then create a Tabbed Page. I would be assumed the second ViewModel called would be the detail page. It instead it overwrites the MasterDetailPage with the Tabbed Page.

Configuration

VS for Mac - Xamarin Forms 3.x
Version: 6.2.2

Platform:

  • [ ] :iphone: iOS
  • [ ] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [X] :monkey: Xamarin.Forms
feature

Most helpful comment

Can you please give us a sample so we can do this ourselves?

All 3 comments

The problem is the TabbedPage over writes the the MasterDetail Page. The solution I want to put in would add a property to the MvxTabbedPagePresentationAttribute to allow routing to a Master or Detail section of MasterDetail. Then I can check for that attribute in the ShowTabbedPage of the MvxFormsPagePresenter and if it exists I can call ReplacePageRoot instead of PushOrReplacePage sending it the MasterDetail information by creating a new MvxMasterDetailPagePresentationAttribute before sending it to ReplacePageRoot. I have this working in a custom app I wrote without issues. I'm just doing some final testing. I just wanted to see if anyone objects to my solution to the issue before coding in this solution and creating a PR.

Can you please give us a sample so we can do this ourselves?

I would like that sample too. :)

Was this page helpful?
0 / 5 - 0 ratings