I'm using a custom master details page. On that page, I implemented the onAppearing() method. It's firing the first time (When I run the program.Master detail page is the root page of my app) only. When I clicked the hamburger icon to open the Navigation drawer, that OnAppearing() is not firing.
MasterDetailsPage CS Code:
public partial class MainMasterDetailPage : MasterDetailPage
{
public MainMasterDetailPage()
{
InitializeComponent();
NavigationPage.SetHasBackButton(this, false);
NavigationPage.SetHasNavigationBar(this, false);
ListOfSettings.IsVisible = false;
this.IsPresented = false;
Detail = new NavigationPage(new DashboardTabbedPage());
}
protected override async void OnAppearing()
{
base.OnAppearing();
ListOfSettings.IsVisible = false;
}
}
I used IsPresentedChanged
property. Please check the below code.
public MainMasterDetailPage()
{
InitializeComponent();
NavigationPage.SetHasBackButton(this, false);
NavigationPage.SetHasNavigationBar(this, false);
ListOfSettings.IsVisible = false;
this.IsPresented = false;
Detail = new NavigationPage(new DashboardTabbedPage());
this.IsPresentedChanged += hideSettingMenu;
}
public void hideSettingMenu(object sender, EventArgs args)
{
ListOfSettings.IsVisible = false;
}