locked
CreateSupportFragment from MasterDetailPage RRS feed

  • Question

  • User385815 posted

    I'm trying to follow the "Xamarin.Forms in Xamarin Native Projects" guide on the Microsoft Docs for embedding Xamarin.Forms pages into my otherwise native Android App. However, I would like to use a MasterDetailPage. But CreateSupportFragment is only defined for a ContentPage, and MasterDetailPage does not derive from ContentPage.

    I tried wrapping it in a ContentPage on the fly, but MasterDetailPage does not seem to like being used in that way, or rather ContentPage.Content or a layouts Children do not take it in.

    How do I use CreateSupportFragment with a MasterDetailPage? Looking at the Code of CreateSupportFragment, it should work unmodified for it, but as it uses internal classes for its job, I can't just copy that Code and do it myself.

    Wednesday, May 22, 2019 7:52 PM

All replies

  • User377758 posted

    I am tring to find the solution, have you got the solution or workaround?

    Thursday, May 23, 2019 3:22 PM
  • User385815 posted

    @Tracy320 said: I am tring to find the solution, have you got the solution or workaround?

    My current workaround is that I have taken the DrawerLayout Template from Visual Studios Xamarin.Android Templates, and am now using that as my Drawer-Layout, and use Xamarin.Forms for anything that gets put into the content.

    For that I placed a dummy as content into the layout, and replace it with the CreateSupportFragment() result via FragmentManager.

    I did not find a proper solution yet unfortunately.

    Thursday, May 23, 2019 3:54 PM