Quantcast
Viewing all articles
Browse latest Browse all 77050

MasterDetailPage: Changing Detail Page changes MasterBehavior

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:

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 77050

Trending Articles