alternative slideover Menu

fsulserfsulser Member ✭✭

I want to have a slideover menu, and tried out two things until now.
First was to use Masterdetailpage. There I see one problem. I want to have the slideover menu and build a stack of the view with navigation and I think this is not possible. The menu should appear on a custom button (a footer basically containing different buttons, one is for the menu). So on page 1 I have masterdetail and it's not a problem, but then when I push to page B with navigation I still want to have that footer and the possibility to show the menu. But I also want to have the possibility to press back button and return to page A. I think thats not possible with Masterdetail.

Therefore I tried Slideoverkit. It does what I want. But I have the impression that it is making the app feel slow and buggy on ios and I'm also missing a drawing functionality to show the menu.

Is there any other framework that would meet my requirements out of the box?

Best Answer

Answers

  • AsurAsur USMember ✭✭✭

    It is possible with master detail . AM guessing on one detail page you need to build a navigation stack ?
    That can be done(have done it myself multiple times + the back button functionality also works fine )

  • LandLuLandLu Member, Xamarin Team Xamurai

    @fsulser Where do you want to place this footer you mentioned above? Specify your requests with some screenshots and the detailed code will be better.

  • fsulserfsulser Member ✭✭
    edited April 2

    @LandLu
    The footer should be in each page.
    In the solution with SlideoverKit I used a control template:

            <ControlTemplate x:Key="HeaderFooterControlTemplate">
                <StackLayout VerticalOptions="FillAndExpand">
                    <StackLayout VerticalOptions="FillAndExpand">
                        <ContentPresenter />
                    </StackLayout>
    
                    <StackLayout HorizontalOptions="FillAndExpand" Orientation="Horizontal" VerticalOptions="End" Margin="0,0,0,5">
                        <Grid HorizontalOptions="FillAndExpand">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <ImageButton Source="menu.png" Grid.Column="0" Grid.Row="0" BackgroundColor="Transparent" HeightRequest="50" Command="{TemplateBinding BindingContext.MenuCommand}" HorizontalOptions="Center"/>
                            <ImageButton Source="home.png" Grid.Column="1" Grid.Row="0" BackgroundColor="Transparent" HeightRequest="50" Command="{TemplateBinding BindingContext.HomeCommand}" HorizontalOptions="Center"/>
                            <ImageButton Source="page1.png" Grid.Column="2" Grid.Row="0" BackgroundColor="Transparent" HeightRequest="50" Command="{TemplateBinding BindingContext.Page1Command}" HorizontalOptions="Center"/>
                        </Grid>
                    </StackLayout>
                </StackLayout>
            </ControlTemplate>
    

    Page1Command would push to a new page, same for HomeCommand. MenuCommand will open the sliding-menu

    And then added it to the views.

  • fsulserfsulser Member ✭✭
    edited April 2

    @JamesLavery thank you. That's exactly the point why I tried to use Slideoverkit instead. I think in my case makes more sense to have a static button and functionality for the slideover. I will take a look at this plugin.

    Is there some specific slideover menu integrated or did you built it on your own? I couldn't find anything specific for a menu yet, but would probably be possible to create that manually

  • fsulserfsulser Member ✭✭

    @JamesLavery I really like that solution.
    First of all it looked a little weard, as it's a new page used, but I think the idea is actually pretty amazing. Because it removes basically any problem with side-effects. Thank you

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @fsulser said:
    @JamesLavery I really like that solution.
    First of all it looked a little weard, as it's a new page used, but I think the idea is actually pretty amazing. Because it removes basically any problem with side-effects. Thank you

    Excellent - the other advantage I think the Popup plugin has is that the menu Page has its own PageModel. This means you're not polluting your normal PageModels with menu code, which I've found to be a problem with solutions like SlideOverKit.

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @fsulser said:
    Is there some specific slideover menu integrated or did you built it on your own? I couldn't find anything specific for a menu yet, but would probably be possible to create that manually

    Sorry - missed this. Have you worked it out? We created a Popup which slides in from the side - gives the same behaviour as a Menu.

  • fsulserfsulser Member ✭✭

    Yes did exactly the same. I'm currently just missing a drawing animation. But as I'm using a base class for all pages I should be able to just add a horizontal draw listener and then open the menu with it.

Sign In or Register to comment.