How to show Menu in MasterDetail Page when using Prism and Custom Title bar

后端 未结 1 794
青春惊慌失措
青春惊慌失措 2021-01-22 15:40

I am completely new to Xamarin.

I am working on a project where Prism framework is used for navigation (my first xamarin project) The requirement needed a custom title

1条回答
  •  故里飘歌
    2021-01-22 16:24

    Just have a boolean property in your Master page's ViewModel, let's call it IsMenuPresented, then in your MasterPage XAML:

    
    

    If you want to be able to toggle the menu from code, you can either:

    1) do something like

    (App.Current.MainPage is MasterDetailPage mainPage).IsPresented = true;
    

    2) Use Prism's Event Aggregator to subscribe to an event in the Master Page's ViewModel that will listen for a true/false value that gets published from some other ViewModel and set IsMenuPresented accordingly (thereby showing/hiding the menu).

    0 讨论(0)
提交回复
热议问题