MasterDetailPage: Changing Detail Page changes MasterBehavior

AgredoAgredo USMember ✭✭
edited August 2018 in Xamarin.Forms


I am using MVVM pattern und have a ViewModes:


Inside the code behind of the UserMainPage I set the MasterBehaivior, The Detail Page and the BindingContext:

MasterBehavior = MasterBehavior.Popover;
Detail = new NavigationPage(new UserHomeDetail());
    BindingContext = new UserMainPageViewModel();

In the UserMasterPageViewModel I navigate to the selected Page by Commad

        var selectedItem = parameter as MasterPageItem;

        if (Navigation == null)
            Navigation = (Application.Current.MainPage as MasterDetailPage).Detail.Navigation;               

        await Navigation.PushAsync(new NavigationPage(selectedItem.Page) , true);

After clicking inside the master page on ne item, the detail page navigates correctly. But the MasterBevavior changes:


Sign In or Register to comment.