Master Detail Page on the right side using Xamarin.Forms
Asked Answered
L

3

9

I've created a master detail page on the left side using Xamarin.Forms, how about creating the same for the right side?

Below is my sample code for the left slider menu;

public class App
{
    static MasterDetailPage MDPage;

    public static Page GetMainPage()
    {
        return MDPage = new MasterDetailPage {
            Master = new ContentPage {
                Title = "Master",
                BackgroundColor = Color.Silver,
                Icon = Device.OS == TargetPlatform.iOS ? "menu.png" : null,
                Content = new StackLayout {
                    Padding = new Thickness(5, 50),
                    Children = { Link("A"), Link("B"), Link("C") }
                },
            },
            Detail = new NavigationPage(new ContentPage {
                Title = "A",
                Content = new Label { Text = "A" }
            }),
        };
    }

    static Button Link(string name)
    {
        var button = new Button {
            Text = name,
            BackgroundColor = Color.FromRgb(0.9, 0.9, 0.9)
        };
        button.Clicked += delegate {
            MDPage.Detail = new NavigationPage(new ContentPage {
                Title = name,
                Content = new Label { Text = name }
            });
            MDPage.IsPresented = false;
        };
        return button;
    }
}
Leukemia answered 15/9, 2014 at 6:17 Comment(1)
Did u find a way to fix it?Demurral
K
2

This does not exists in the Xamarin.Forms controls set, but you can create your own, with renderers for each platform.

You'll find the required information on http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/

Knowlton answered 15/9, 2014 at 7:16 Comment(0)
O
0

Solution here

this is now supported in xamarin forms 3.0 and up, NO custom renderers needed !! or third party libraries.

the trick is to force the layout to RTL, while flow direction works, its hard to make the top nav bar to follow, below is the solution for that problem, it works... let me know if you face any issues on older ios versions IOS8 and less.

xamarin forms RTL master details page with icon RTL/LTR hamburger

Overmuch answered 31/5, 2018 at 16:53 Comment(0)
V
-2

You can make it by ToolbarItems in Xamarin Forms ToolbarItems will appear in right side.

You can find more info from the following links : http://codeworks.it/blog/?p=232

Vouchsafe answered 6/7, 2015 at 5:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.