Forum Xamarin.Forms

CreateSupportFragment from MasterDetailPage

OromitOromit Member

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.


  • Tracy320Tracy320 Member ✭✭✭

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

  • OromitOromit Member

    @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.

Sign In or Register to comment.