Closed ghost closed 8 years ago
I want to have a different SlideMenu depending on which ToolBarItem is tapped.
Looking at the code for MenuContainerPage, the following code looks like it should work:
public partial class LocationListPage : MenuContainerPage { #region Constructors public LocationListPage () { InitializeComponent (); } #endregion Constructors protected override void OnAppearing () { base.OnAppearing (); MessagingCenter.Subscribe<LocationListPageModel> (this, MessagingConstants.LocationsSortMenuShow, (sender) => { this.SlideMenu = new LocationsSortMenuView (); ShowMenu (); }); } protected override void OnDisappearing () { base.OnDisappearing (); MessagingCenter.Unsubscribe<LocationListPageModel> (this, MessagingConstants.MenuShow); } }
However, the menu does not show. It only works if I set this.SlideMenu in the constructor.
Any solution to this, and/or suggestions?
Well, it cannot be add, cause of OnAppearing will be called after OnElementChanged. How about change the content in MenuView in runtime? Like set IsVisible for ViewA and un visible for ViewB
I want to have a different SlideMenu depending on which ToolBarItem is tapped.
Looking at the code for MenuContainerPage, the following code looks like it should work:
However, the menu does not show. It only works if I set this.SlideMenu in the constructor.
Any solution to this, and/or suggestions?