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

MasterDetailPage: Changing Detail Page changes MasterBehavior

$
0
0

Hello,

I am using MVVM pattern und have a ViewModes:

UserMasterPageViewModel

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:


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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