Forum Xamarin.Forms

Xamarin Form Shell Page with backbutton

AlbertKAlbertK MYMember ✭✭✭✭
edited September 2019 in Xamarin.Forms

I have the flyout item set out as below. The issue is, Why is default hamburger icon not changed to the back arrow when About page is clicked. If i call the About page from a button in TabPageOne (via Navigation.PushAsync(new AboutPage()) then the back arrow appears.

Xamarin Forms v
Windows VS 2019 v16.3.1

 <FlyoutItem Route="Main" FlyoutDisplayOptions="AsSingleItem" Title="Main"   >
        <Tab Title="Tab One" Route="tabone" >
            <ShellContent ContentTemplate="{DataTemplate local:TabPageOne}" />

        <Tab Title="Tab Two" Route="tabtwo">
           <ShellContent ContentTemplate="{DataTemplate local:TabPageTwo}" />

        <Tab Title="Tab Three" Route="tabthree" >
            <ShellContent  ContentTemplate="{DataTemplate local:TabPageThree}"  />

<FlyoutItem Title="Profile"  >
        <ShellContent Title="Profile" ContentTemplate="{DataTemplate local:ProfilePage}" />
<FlyoutItem Title="Key" >
            <ShellContent Title="Key" ContentTemplate="{DataTemplate local:KeyPage}" />
    <FlyoutItem Title="About">
        <ShellContent Title="About" ContentTemplate="{DataTemplate local:AboutPage}"  />

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
             x:Class="MyApp.View.AboutPage" NavigationPage.HasBackButton="True" NavigationPage.HasNavigationBar="True">

        <StackLayout Orientation="Vertical" VerticalOptions="CenterAndExpand">
            <Label Text="MyApp" FontSize="Large" FontAttributes="Bold" HorizontalOptions="CenterAndExpand"/>
            <Label Text="Powered with Xamarin" FontSize="Medium" HorizontalOptions="CenterAndExpand" />

Best Answer


  • HamittirpanHamittirpan Member ✭✭✭✭

    @AlbertK The FlyoutItem you define in the Shell menu behave like the first page. Why do you want to add them back button?

  • AlbertKAlbertK MYMember ✭✭✭✭

    @Hamittirpan, Well with the flyout that is not a Tab, I would like it to behave like a Navigation.PushAsync() called. MenuItem can be used in Shell but it looks like an ugly hack.

Sign In or Register to comment.