Migrating from MasterDetail to Flyout, and how to make a common page view?

Jesse Knott 686 Reputation points
2021-09-08T06:35:43.23+00:00

Yes, I am aware there are two questions to this, perhaps a third in asking if I even need to worry about migrating from MasterDetail at all.
I've been going over my code, migrating some API's and so on.

One issue I have been finding is that MasterDetail is deprecated. I would like to migrate to FlyOut but I'm having issues with finding any sort of details how to migrate from one to the other. I would prefer to not rebuild the entire framework of the app, but I was hoping to find some easier method of just wrapping my existing framework into a new one.

One of the things I have been faced with as well is that I want to make a free version of my app. I want to add ads to the pages, and the easiest way to do this would be to create a frame that the pages load into, but has it's own structure. Not that I think it's important, but I've been working with the MTAdMob plugin (due to it seeming the easiest implemenation), and I have a separate question about ads and free vs paid, but that's for a different thread. possibly tomorrow.

I was imagining that I could do something like

    <MasterDetailPage.Master>
        <views:MenuPage />
    </MasterDetailPage.Master>

    <MasterDetailPage.Detail>

        <NavigationPage>
            <x:Arguments>
                <views:FrameworkPage/>
            </x:Arguments>
        </NavigationPage>
    </MasterDetailPage.Detail>

Then in the framework page, to have something like

 <ContentPage.Content>
        <ScrollView>
           <StackLayout>
                <AdControl />
           </StackLayout>

           <StackLayout x:Name="DynamicPage">

        </ScrollView>
</ContentPage.Content>

I would have to figure out a way to rewiring the NavigationStack to use pointers to the DynamicPage layout object.

So in summary I guess my questions are mainly,
a) are there any good tutorials on migrating from MasterDetail to Flyout?
b) I suppose this is something that would probably be easier to implement in Flyout but how can I make a generic page container? or do I need to put the ads and purchased vs free logic into each page individually?

Any tips or points in a particular direction are most appreciated!
Cheers!

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,357 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jesse Knott 686 Reputation points
    2021-09-08T20:08:22.537+00:00

    Wow, okay, I needed to just play with it some. Sorry for the question.
    Migrating from MasterDetail was basically just a matter of changing MasterDetail to FlyoutPage. With perhaps one or two minor tweaks...

    As for the adding the dynamic frame for having ads, I realized I can overload the way the detail page is displayed and use a template page that has the navigation stack embedded in it...

    Yikes I feel like an idiot...
    LOL
    I guess all's well that ends well...

    Cheers!


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.