Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to use MasterBehavior in Xamarin Forms

$
0
0

Hi everyone

I am facing issue when i am using MasterBehavior getting error can you please guide me how i can use MasterBehavior = MasterBehavior.Split; i want to split my masterdetailpage in ios platform i am using Native Portable Project please guide me its urgent for me thank you in advance.
this is my code

public class RootPage : MasterDetailPage
{
public RootPage()
{
var menuPage = new MenuPage();
menuPage.Menu.ItemSelected += (sender, e) => NavigateTo(e.SelectedItem as MenuItem);
Master = menuPage;
Detail = new NavigationPage(new ContractsPage());

        MasterBehavior = MasterBehavior.Split;
    }

    void NavigateTo(MenuItem menu)
    {
        Page displayPage = (Page)Activator.CreateInstance(menu.TargetType);
        Detail = new NavigationPage(displayPage);
        IsPresented = false;

    }
}

public enum MasterBehavior
{
    Default,
    Popover,
    Split,
    SplitOnLandscape,
    SplitOnPortrait
}

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>