I've built a Xamarin Forms Project (PCL) from template (VS 2017) with:
App.xaml.cs
MainPage = new NavigationPage(new MainPage());
MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp"
x:Class="MyApp.MainPage">
<ContentPage.ToolbarItems >
<ToolbarItem Name="AppSettings" Order="Secondary" Priority="0" Activated="AppSettings_Activated" Text="App Settings"></ToolbarItem>
<ToolbarItem Name="ProjectsAdministration" Order="Secondary" Priority="1" Text="Projects Administration"></ToolbarItem>
</ContentPage.ToolbarItems>
<ContentPage.Content>
<Label Text="Welcome to Xamarin Forms!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</ContentPage.Content>
</ContentPage>
MainPage.xaml.cs
async private void AppSettings_Activated(object sender, EventArgs e)
{
await Navigation.PushAsync(new AppSettingsPage());
}
When I navigate to AppSettingsPage the toolbar is still visible, but the ToolbarItems have disappeared. I would have ecpected them to be also visible. (???)