我创建了一个运行良好的菜单,但是在某些未使用该菜单打开的页面上,该菜单替换为后退按钮。无论如何,是否要确保所有页面上都有菜单?
mainpage.xaml
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<pages:HomePage />
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Detail>
Homepage.xaml.cs
var masterDetailPage = Application.Current.MainPage as MasterDetailPage;
masterDetailPage.Detail = new NavigationPage((new SearchPage("A")));
答案 0 :(得分:1)
通过替换详细信息部分替换了PushAsync
Navigation.PushAsync(new SearchPage("a"));
var masterDetailPage = Application.Current.MainPage as MasterDetailPage;
masterDetailPage.Detail = new NavigationPage((new SearchPage("a")));